Commit Graph

29 Commits

Author SHA1 Message Date
Brian C. Lane
a286e9b3dc Fix composer-cli blueprints changes to get correct total
blueprints/changes is different, each blueprint has it's own total,
limited by the call's limit. So it needs to find the max total of all
the requested blueprints.

(cherry picked from commit 57674c9a1a)
2018-08-27 12:02:39 -07:00
Brian C. Lane
187cd935df Add a function to get_url_json_unlimited to retrieve the total
The blueprints/changes API is a bit different from the others, the total
that it includes is for each blueprint, not one total for all of them,
since there will be a different number of commits for each.

The function is passed the dict, and it can be used to select the total
to use for retrieving all of the results. If it isn't included it will
use data["total"] which works fine in most cases.

(cherry picked from commit 0a76d635ca)
2018-08-27 12:02:39 -07:00
Brian C. Lane
9249d21d6f Use urllib.parse instead of urlparse
python3 moved this to a new module.

(cherry picked from commit 86d556e87c)
2018-08-21 16:50:53 -07:00
David Shea
e3ef3d9a29 In composer-cli, request all results
Add a limit argument to all potentially paginated results, equal to
whatever the composer backend is the total number of results. This still
has the potential to provide truncated data if the number of results
increases between the two HTTP requests.

Resolves: #404
(cherry picked from commit ee98d87cea)
2018-08-21 16:50:53 -07:00
Brian C. Lane
8694c7a7dc composer-cli should not log to a file by default
The user can pass --log /path/to/logfile.log if they want logging
enabled.

(cherry picked from commit 844ff9998b)
2018-08-21 11:59:12 -07:00
Chris Lumens
312faf6275 Fix a little bug in running "modules list".
(cherry picked from commit 5dddef6f49)
2018-08-10 12:00:54 -04:00
Chris Lumens
9c188b84a6 Update composer-cli for the new error return types.
(cherry picked from commit bc96f75992)
2018-08-09 16:33:19 -04:00
Brian C. Lane
716fb3277f Add job_* timestamp support to compose status 2018-08-07 15:21:22 -07:00
Will Woods
3f8b9d7737 composer-cli: clean up "list" commands
This patch does two things:

1) Add "compose list", which lists compose UUIDs and other basic info,
2) Fix up "blueprints list", "modules list", "sources list", and
   "compose types" so their output is just a plain list of identifiers
2018-08-07 10:18:10 -07:00
Brian C. Lane
c52d45e168 composer-cli: Add support for Group to blueprints diff
(cherry picked from commit 2edd7a995b)
2018-08-06 17:00:56 -07:00
Brian C. Lane
1fff409465 Update status.py to use new handle_api_result
Use the new function to properly handle error responses for all the
commands.

(cherry picked from commit 642f117d54)
2018-08-06 17:00:56 -07:00
Brian C. Lane
2ec00fb5ce Update sources.py to use new handle_api_result
Use the new function to properly handle error responses for all the
commands.

(cherry picked from commit 3205e47a13)
2018-08-06 17:00:56 -07:00
Brian C. Lane
14542df02c Update projects.py to use new handle_api_result
Use the new function to properly handle error responses for all the
commands.

(cherry picked from commit 77767cd93a)
2018-08-06 17:00:56 -07:00
Brian C. Lane
6614f65198 Update modules.py to use new handle_api_result
Use the new function to properly handle error responses for all the
commands.

(cherry picked from commit b55b86d0b3)
2018-08-06 17:00:56 -07:00
Brian C. Lane
35e2471e41 Update compose.py to use new handle_api_result
Use the new function to properly handle error responses for all the
commands.

(cherry picked from commit 760aeb61a7)
2018-08-06 17:00:56 -07:00
Brian C. Lane
7e5590d459 Update blueprints.py to use new handle_api_result
Use the new function to properly handle error responses for all the
commands.

(cherry picked from commit c1c5536ec8)
2018-08-06 17:00:56 -07:00
Brian C. Lane
74d76789e1 Modify handle_api_result so it can be used in more places
Some results have errors and no status, others have status and errors.
Update the function to return the final rc to exit with, and a bool
indicating whether or not to continue processing the other fields.

Add a bunch of tests for the new function to make sure I have the logic
correct.

(cherry picked from commit 35fa067219)
2018-08-06 17:00:56 -07:00
Chris Lumens
d598b51294 Fix help output on the compose subcommand.
(cherry picked from commit a3572c9fdd)
2018-07-26 14:25:55 -04:00
Chris Lumens
4aa6768e03 Add timestamps to "compose-cli compose status" output.
(cherry picked from commit 7bcb61849d)
2018-07-26 14:25:52 -04:00
Chris Lumens
20fb27ec41 And then add real output to the status command.
(cherry picked from commit eb0939d967)
2018-07-26 14:25:48 -04:00
Chris Lumens
23892f19eb Add the beginnings of a new status subcommand.
(cherry picked from commit 9eafc60fa0)
2018-07-26 14:25:38 -04:00
Brian C. Lane
4eae24de40 composer-cli: Fix non-zero epoch in projets info
The json value is an int, so convert it to a str.

(cherry picked from commit 18521cec1a)
2018-07-25 11:39:34 -07:00
Brian C. Lane
de0e5d2b59 Check /projects responses for null values.
Some values can be null/None so check for that instead of crashing.

(cherry picked from commit f916e41d00)
(cherry picked from commit 83680d92b0)
2018-07-18 16:44:44 -07:00
Chris Lumens
f5115291bd Add help output to each subcommand.
This is the same as the output at the top level, just trimmed down to
only the options for a single subcommand.  It's trigged by providing
"help" or "--help" as a subcommand option.

(cherry picked from commit 954f330ace)
(cherry picked from commit bb8fdcb854)
2018-07-18 16:35:48 -07:00
Chris Lumens
0179a976ba Split the help output into its own module.
This means I can reuse it for help output for individual subcommands.

(cherry picked from commit 70e4211ad1)
(cherry picked from commit eba5658a71)
2018-07-18 16:35:48 -07:00
Chris Lumens
18620700fd If the help subcommand is given, print the help output.
This isn't a real subcommand like the others.  The option processing
just intercepts it and prints the output.  Given that we're subcommand
based, it makes sense to support this in addition to --help.

(cherry picked from commit 3743d6d208)
(cherry picked from commit 3c6478e179)
2018-07-18 16:35:48 -07:00
Brian C. Lane
0314cbd0e8 Add support for sources to composer-cli
This adds the sources command which can be used to list, add, change,
and delete sources using the TOML formatted source file.

(cherry picked from commit 6f6ce410c0)
2018-06-04 15:48:41 -07:00
Brian C. Lane
e7f9028fca Move lorax-composer and composer-cli argument parsing into modules
This allows sphinx-argparse to document them automatically.
2018-05-17 10:34:35 -07:00
Brian C. Lane
fb58277028 Add composer-cli and tests 2018-05-17 10:34:34 -07:00