150 Commits

Author SHA1 Message Date
Ian Cordasco
92133f2901 Relax requirement of region-id for hosts and cells
When listing hosts and cells, there is no need to require the user to
provide a region-id. The API previously required region IDs to be
present in the query string to list hosts and cells, but relaxed this
constraint. The craton CLI encoded this constraint in its parameters but
now needs to relax this as well.

Change-Id: I973176a150c5d10de2144501dcc39cd6cfacbf9a
Closes-bug: #1659428
2017-03-01 08:25:36 -06:00
Sulochan Acharya
94456b6617 Add filter params to host-list command
$craton host-list needs to allow some of the filtering
parameters to users to be able to filer host listing.

This patch adds --ip, --device-type, --vars and --label
parameters as allowed filters to host-list.

Closes Bug: 1659235

Change-Id: I663079ca454a3451c2688c518884243da1488b85
2017-03-01 11:41:35 +00:00
OpenStack Proposal Bot
4ae51367ff Updated from global requirements
Change-Id: I6981c85e0ecb2c399e7a27654500267c8a5a2634
2017-03-01 04:15:22 +00:00
Ian Cordasco
dcd5b025d2 Update regions commands to use pluggable formatters
This allows users to specify a formatter for the entirety of the craton
command-line client via --format.

Change-Id: I3a4795b14f1f4c9e2df62c83d5d9360afd56f324
2017-02-28 13:28:28 -06:00
Ian Cordasco
6bb372ea37 Update projects commands to use pluggable formatters
This allows users to specify the formatter they want to use and have the
project-* subcommands honor it.

Change-Id: I4ea6f0d679f6167a1b4865d8d51f5c6ef07c58cd
2017-02-28 13:15:10 -06:00
Ian Cordasco
d8e31c39cc Update clouds commands to use pluggable formatters
This updates the clouds-* command-line entry points to use the formatter
chosen by the user with --format.

Change-Id: I4d07abc41cb93589889c0599eff426544467a965
2017-02-28 12:03:21 -06:00
Ian Cordasco
ab49589345 Update cells commands to use pluggable formatters
This now allows users of the cell-* command-line entry points to use the
formatter provided by --format.

Change-Id: I1e2356f4d38051c97af68e48f12d0ec95ac6167a
2017-02-28 11:24:25 -06:00
Ian Cordasco
0ec761cb96 Update hosts commands to use pluggable formatters
After our last change, we can begin to allow users to specify formatters
for host command output.

Change-Id: I22bc9421bf0b47ef07ae7c149a32ff8b074906d2
2017-02-27 14:33:19 -06:00
Ian Cordasco
d1a88bad18 Add --format to the client shell
Add a new way of formatting our output in a consistent way. This turns
print_list and print_dict into a formatter that has the same API as any
other formatter and allows users to create their own formatters and plug
them into cratonclient.

This includes tests for the base level formatter and our two default
formatters as well as some refactoring to allow users to specify their
own --format.

At the moment, however, the subcommand shells do *not* use the pluggable
formatter decided by the user. That change and all of the downstream
effects it has on testing is going to be *very* significant and deserves
its own commit as this one is large enough.

Change-Id: I6649ebce57d5ddf2d4aeb689e77e3c17ef3a2e97
2017-02-27 14:31:59 -06:00
Ian Cordasco
d41c87c725 Reorganize shell based integration tests
This now follows the same organization as the unit tests have in
cratonclient.

Change-Id: If7a4397cec8010adc50a591ec536bf8142197442
2017-02-27 08:39:03 -06:00
Thomas Maddox
a2787af05b Adds basic Cloud resource CRUD to CLI
This patch adds basic CRUD operations for
the Cloud resource in the Craton API and
integrates cloud_id throughout dependent
child resources.

Change-Id: If33c13082e31ee9f76278926538c707c559e41d0
Closes-Bug: 1666947
Depends-On: Ib1c16a504430760f2a7234221f91429a7ea72596
2017-02-24 20:49:39 +00:00
Jenkins
2f9e474b4d Merge "Add parent_id to host fields" 2017-02-23 12:01:54 +00:00
OpenStack Proposal Bot
ae4a2756d8 Updated from global requirements
Change-Id: I4b02947ba3a1594067a3f36b57f75499d9e1ac0c
2017-02-15 20:53:13 +00:00
Ian Cordasco
892cba1651 Add support to the client for autopagination
This adds pagination support to the underlying client as well as
autopagination support on the CLI.

This adds --all and --marker to the associated
{cells,hosts,projects,regions}-list commands.

Depends-On: I11c5c6053e5f0873ee53df5b7dcb9b2ed25a0b64
Change-Id: Ic1f8f01e052ff7870f731d6c8a5d47d58d9dcfe9
2017-02-15 14:22:00 -06:00
git-harry
8a2194f629 Add parent_id to host fields
This change allows the client to display the host parent_id. When using
craton host-show the property is displayed by default, when using craton
host-list the property must be selected using --fields.

Change-Id: Ieb482ff5f2e31d79ad817b65dcb9a55df2ed0ef2
Partial-bug: 1662496
2017-02-14 10:05:38 +00:00
git-harry
9ba64600ee Fix help messages for resource-listing commands
--fields takes a space-separated list and not a comma-separated list.

Change-Id: Id595970d97f46a8a024133f7cc7d8594fcb4be3b
2017-02-10 15:41:15 +00:00
git-harry
78b6473ef7 Fix last updated field name for resources
Craton resources have a property, `updated_at`. This commit corrects the
client to look for that property using the correct name. Without the
change the client is looking for `update_at` which causes the output for
that property to be blank.

Change-Id: If041f97594038e2e66ba3a664a514e5d2447bd18
2017-02-10 15:28:33 +00:00
Thomas Maddox
24de28869d Adds Project CLI commands
Adding cli commands associated with /projects api.

Closes-Bug: 1659237

Change-Id: Ic3375176ddf85d283f784d59307be434cefac9e0
2017-02-09 16:34:32 +00:00
avnish
9ef23fcbfc Remove link to modindex
The documentation build does not generate any module index, thus
remove the link to the page.

Change-Id: I894b0ca5f4d56772ae6d50d08858f4252445f1f8
2017-02-03 11:17:14 +05:30
Jenkins
3912b47732 Merge "Remove access_secret_id from cratonclient" 2017-01-26 14:18:07 +00:00
Sulochan Acharya
6ef0486b5c Fixes --help and command help for cratonclient
Both craton --help and craton help <COMMAND> is
broken for different reasons. This patch fixes
that by adding do_help function for help subcommand
and by displaying suparsed argument of --help.

Closes Bug: 1659092

Change-Id: I838c780ada21edb8202d0fda6bfc982bc57c253b
2017-01-25 17:18:44 +00:00
Sulochan Acharya
fe8fe5989a Remove access_secret_id from cratonclient
We dont use and wont be using access_secret_id
the way it is right now. This patch therefore
removes this since it does not work at all.

Closes Bug: 1659104

Change-Id: I3ac685cb3958742a348007b40cedf6be5293ca7d
2017-01-25 15:00:46 +00:00
Jenkins
4c1fac38bf Merge "Add Constraints support" 2017-01-23 15:34:39 +00:00
OpenStack Proposal Bot
0fa6d32184 Updated from global requirements
Change-Id: I5aaf10032714a802f0540d6cb4a40a7e8b581444
2017-01-21 15:56:09 +00:00
Tony Breeds
612ee985a1 Add Constraints support
Adding constraints support to libraries is slightly more complex than
services as the libraries themselves are listed in upper-constraints.txt
which leads to errors that you can't install a specific version and a
constrained version.

This change adds constraints support by also adding a helper script to
edit the constraints to remove python-cratonclient.

Change-Id: Iddf349b3833908c35ecbfeba535b17d431c85b0c
2016-12-21 14:08:42 +11:00
Jenkins
b6d160471f Merge "Add specification directory, template, and indices" 2016-12-16 19:01:14 +00:00
Ian Cordasco
4931ec5725 Add specification directory, template, and indices
Change-Id: I7245e6d3221f4ceef3b59107e6ff01e1ed2206cb
2016-12-08 13:36:51 -06:00
OpenStack Proposal Bot
18ab9bff96 Updated from global requirements
Change-Id: I1611bfc88c9aef62dfe5b5dfa5cf47bb0f43bc8b
2016-12-06 23:33:53 +00:00
Jenkins
02a3acb4ef Merge "Add functions for authenticating to Craton" 2016-12-06 18:35:47 +00:00
Ian Cordasco
e4a4a98496 Add functions for authenticating to Craton
This adds a cratonclient.auth with craton_auth and keystone_auth
functions to generate cratonclient.session.Session objects with
appropriate authentication plugins set-up.

Closes-bug: 1643961
Change-Id: I661a91241b96ca5c45a91a0add4f74c4ca7e6750
2016-12-06 11:26:09 -06:00
Sulochan Acharya
1c16356257 Adds region-list shell command
Regions shell commands is currently missing
region-list function. This patch addes the
shell command and adds some test for it too.

Closes-Bug: #1614765

Change-Id: Ic5aa1a4f024f3978f940daeb0e273226a3b4970f
2016-11-23 15:43:01 +00:00
Jenkins
d899af309c Merge "Remove buggy technical debt code" 2016-11-23 11:47:35 +00:00
Jenkins
72b8c903a2 Merge "Remove the Inventory object from the Client" 2016-11-23 11:46:11 +00:00
Ian Cordasco
399a81dbc1 Remove buggy technical debt code
A little while ago, we started using KeystoneAuth for everything. This
means we can simplify our code a lot.

First, we can off-load request/response logging to KeystoneAuth which is
where we stole our (broken) code from originally.

Second, we can remove the handling around endpoint_filtering (again
because we only ever use KeystoneAuth).

Change-Id: Ie05bb0a7ecdc339130f29ba322b56913854909bd
Closes-bug: 1643650
2016-11-22 11:36:50 -06:00
Ian Cordasco
5e53de8ac2 Remove the Inventory object from the Client
As a matter of design and practicality, we have decided to remove the
Inventory object which was awkward, underspecified, and frankly the
wrong layer of abstraction from the Client. Hosts, Cells, etc. will now
be accessible directly from the client itself.

Change-Id: I4a65761ad39d0b7cb881a97c5f3367cafa9db557
2016-11-21 15:33:16 -06:00
OpenStack Proposal Bot
062a9c0f8c Updated from global requirements
Change-Id: I5b23922ebeea0e73ccfec611faa3ec75dc25e76c
2016-11-17 15:08:01 +00:00
Jenkins
9260ffdefa Merge "Add documentation for using Craton Python API" 2016-11-17 02:59:45 +00:00
OpenStack Proposal Bot
afb6e94294 Updated from global requirements
Change-Id: I4adc854c95f9d17e60f2e7abf6c31efb283d8b50
2016-11-16 00:33:13 +00:00
Ian Cordasco
4c4f679fbd Add documentation for using Craton Python API
This adds some basic documentation describing how to authenticate
against Craton and provides some preliminary auto-generated
documentation of objects.

Change-Id: I2692a80785662e3193e56b62ed78cbe8de9f6e51
2016-11-15 15:26:48 -06:00
Ian Cordasco
637a25c1a0 Improve help text for base arguments
Add more unit tests for the cratonclient.shell.main module and refactor
some of the logic in that module to be more future-proof.

Change-Id: Iddfc5a170d15de77e1e400c2fa54b4a91cd94b7a
2016-11-10 13:18:49 -06:00
Ian Cordasco
e89a10eb24 Add unit tests for region-* shell commands
Change-Id: Id7a5418233f17baaa4e0d72ea1b3d26b4dc46783
2016-11-07 13:23:18 -06:00
Ian Cordasco
8799e275a9 Use new idiom in cells_shell tests
Change-Id: I271fc2163c997972c690c8bcc4edc870ccc756af
2016-11-04 14:00:41 -05:00
Ian Cordasco
7562ab3e3a Refactor shell unittests and add hosts shell tests
This refactors our shell unittest helpers into three base classes for
further unit test classes to subclass and extend. This also corrects
some problems with the hosts shell parameters that either didn't
previous work or were wrong and no longer belong. Finally, it removes
project_id from places where it no longer belongs.

Change-Id: Ibd6a36714135d14355c3b4f48fced83b852581a9
2016-11-03 10:55:18 -05:00
Jenkins
bdace66273 Merge "Add unit tests for cratonclient.shell.v1.cells_shell" 2016-10-31 10:07:25 +00:00
Jenkins
eb30153fdb Merge "Move v1 resource tests to their own directory" 2016-10-31 10:07:14 +00:00
Ian Cordasco
362217dfb5 Install requirements.txt in tox venvs as well
This allows things like tox -e venv to work as well, so you can do

    tox -e venv -- python
    >>> from cratonclient ... import ...

Without getting an ImportError for a missing dependency.

Change-Id: I75955c6fe7d6b4403eff8995932ff3ea3cb961b3
2016-10-28 15:27:00 -05:00
Ian Cordasco
25dd5170e2 Add unit tests for cratonclient.shell.v1.cells_shell
This adds a number of unit tests around the cells_shell logic that
should allow our integration tests to start operating differently.
We will likely end-up extracting some of the common logic for the _shell
unit test modules to a base test case class so we can use those methods
across all the unittests more conveniently.

Change-Id: I60a6e7c89aec6c1104177b92b6e2e358adfe01d5
2016-10-28 12:35:16 -05:00
Ian Cordasco
b0b32937b9 Move v1 resource tests to their own directory
The region and inventory tests belong in their own sub-directory of the
unit test directory. This will allow future versions of craton to have
tests in tests/unit/v2/ that are similarly named.

Change-Id: I62b657ac7137009d02c2476a90698f54d2f0fa5a
2016-10-28 12:32:52 -05:00
Ian Cordasco
c1662135a4 Relocate our shell testing to where it belongs
Most of our shell testing belongs in our integration test folder. These
tests are mocking out standard out and standard in as well as other
collaborators while still integrating with other collaborators. These
belong in cratonclient.tests.integration as a result.

Change-Id: I3a73637d25604112f252e21dde21f8b9b582be14
2016-10-27 07:33:05 -05:00
Ian Cordasco
acf0a8c357 Add integration tests
Our first "official" integration tests are for our cratonclient.crud
module.

Change-Id: Ib54853272394a0b86a1ac6c70d3870576d5c4cf2
2016-10-27 07:33:05 -05:00