Commit Graph

30 Commits

Author SHA1 Message Date
Lars Karlitski
2c2e3156d0 Rename composer-cli to composer
Resolves: rhbz#1635763
2018-10-05 08:30:34 -07:00
Brian C. Lane
55d2911c7d 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:09:27 -07:00
Brian C. Lane
8e3d2b0252 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:09:27 -07:00
Brian C. Lane
a2b83bd771 Use urllib.parse instead of urlparse
python3 moved this to a new module.

(cherry picked from commit 86d556e87c)
2018-08-21 17:05:24 -07:00
David Shea
d6418246ad 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 17:05:24 -07:00
Brian C. Lane
d8750db166 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 12:09:38 -07:00
Chris Lumens
ff5ac5045b Fix a little bug in running "modules list".
(cherry picked from commit 5dddef6f49)
2018-08-10 12:01:10 -04:00
Chris Lumens
6b36d2a188 Update composer-cli for the new error return types.
(cherry picked from commit bc96f75992)
2018-08-09 16:50:46 -04:00
Brian C. Lane
f7c4c3f5d5 Add job_* timestamp support to compose status 2018-08-07 15:34:35 -07:00
Will Woods
e673fd5927 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 12:12:17 -07:00
Brian C. Lane
f791d5aff6 composer-cli: Add support for Group to blueprints diff
(cherry picked from commit 2edd7a995b)
2018-08-07 12:12:17 -07:00
Brian C. Lane
5af7ad6600 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-07 12:12:17 -07:00
Brian C. Lane
926d88a3bd 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-07 12:12:17 -07:00
Brian C. Lane
7e999cc9c6 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-07 12:12:17 -07:00
Brian C. Lane
ecefa18110 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-07 12:12:17 -07:00
Brian C. Lane
92f5860182 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-07 12:12:17 -07:00
Brian C. Lane
e21c53f507 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-07 12:12:17 -07:00
Brian C. Lane
85b2807a15 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-07 12:12:17 -07:00
Chris Lumens
c3987cc4cb Fix help output on the compose subcommand.
(cherry picked from commit a3572c9fdd)
2018-07-26 14:53:57 -04:00
Chris Lumens
db98df8373 Add timestamps to "compose-cli compose status" output.
(cherry picked from commit 7bcb61849d)
2018-07-26 14:53:53 -04:00
Chris Lumens
5ff96bc627 And then add real output to the status command.
(cherry picked from commit eb0939d967)
2018-07-26 14:53:50 -04:00
Chris Lumens
c6efcd1fc2 Add the beginnings of a new status subcommand.
(cherry picked from commit 9eafc60fa0)
2018-07-26 14:53:47 -04:00
Brian C. Lane
4b8211a471 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:55 -07:00
Brian C. Lane
ea5e34e9c6 Check /projects responses for null values.
Some values can be null/None so check for that instead of crashing.

(cherry picked from commit de0e5d2b59)
2018-07-19 11:00:58 -07:00
Chris Lumens
76c811b7b8 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 f5115291bd)
2018-07-19 10:59:45 -07:00
Chris Lumens
cd5c9385f6 Split the help output into its own module.
This means I can reuse it for help output for individual subcommands.

(cherry picked from commit 0179a976ba)
2018-07-19 10:59:38 -07:00
Chris Lumens
eca6a01008 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 18620700fd)
2018-07-19 10:59:31 -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