The --or-show option is added to create commands for the common case
of needing to ensure an object exists and getting its properties if
it does or creating a new one if it does not exist.
Note that if the object exists, any additional options that would
set values in a newly created object are ignored if the object
exists.
FakeResource needs the __name__ attribute to fall through utils.find_resource.
Prove the concept on v2 user create then propogate once we're happy with it...
Change-Id: I6268566514840c284e6a1d44b409a81d6699ef99
We should use the fixture generation code from keystoneclient rather
than keep our own copies of the token and discovery structure.
Change-Id: I53c1d2935d1d65c39b8abea89427af2fc3edd181
A federated user can authenticate with the v3unscopedsaml plugin and
list the domains and projects she is allowed to scope to.
This patch introduces the new commands 'federation domain list' and
'federation project list'.
Note that for these commands -and plugin- to be available, the lxml
library must be installed.
Change-Id: I2707b624befcfb0a01b40a094e12fd68a3ee7773
Co-Authored-By: Florent Flament <florent.flament-ext@cloudwatt.com>
This patch allows the user to choose which authentication plugin
to use with the CLI. The arguments needed by the auth plugins are
automatically added to the argument parser. Some examples with
the currently available authentication plugins::
OS_USERNAME=admin OS_PROJECT_NAME=admin OS_AUTH_URL=http://keystone:5000/v2.0 \
OS_PASSWORD=admin openstack user list
OS_USERNAME=admin OS_PROJECT_DOMAIN_NAME=default OS_USER_DOMAIN_NAME=default \
OS_PROJECT_NAME=admin OS_AUTH_URL=http://keystone:5000/v3 OS_PASSWORD=admin \
OS_IDENTITY_API_VERSION=3 OS_AUTH_PLUGIN=v3password openstack project list
OS_TOKEN=1234 OS_URL=http://service_url:35357/v2.0 \
OS_IDENTITY_API_VERSION=2.0 openstack user list
The --os-auth-plugin option can be omitted; if so the CLI will attempt to
guess which plugin to use from the other options.
Change-Id: I330c20ddb8d96b3a4287c68b57c36c4a0f869669
Co-Authored-By: Florent Flament <florent.flament-ext@cloudwatt.com>
Replicate the object-store container command tests but use requests_mock
to test the entire stack down to the requests module.
These will be useful regressions tests when the existing object-store lib
modules are moved to the low-level API object.
Change-Id: Ibf25be46156eb1009f1b66f02f2073d3913b846d
This is step 1 toward using Keystone client's session.Session as the
primary session/requests interface in OSC.
* Move the session create into ClientManager and rename 'restapi' attribute to 'session'
* Set up ClientManager and session loggers
* Fix container and object command references to restapi/api
Change-Id: I013d81520b336c7a6422cd22c05d1d65655e64f8
Allows client libraries to have complete access to the rest of the
OSC ClientManager. In addition, extension libraries can define
global options (for API version options/env vars) and define
versioned API entry points similar to the in-repo commands.
The changes to ClientManager exposed some issues in the existing
object api tests that needed to be cleaned up.
Change-Id: Ic9662edf34c5dd130a2f1a69d2454adefc1f8a95
This finally gets all of the API tests into a common framework regarding
test classes and so forth.
Change-Id: If675347129c50dcba0bfc5b6c58f5a2ca57ff46c
* Split identity/fakes.py for v2_0 and v3
* Split identity/test_identity.py for v2_0 and v3
* Fix issues in commands with enable/disable
* Clean up v2 commands
Change-Id: I6e536b6a130fc556dbd7dcf9f2e76d939ca1bc1c
* Move fake data structures into tests/identity/fakes.py
* Use fake clients correctly and support multiple client versions
Change-Id: Icacbb2ca740b63937bd2c4442af61b620638b53e
* Add object-store API to ClientManager
* Add object-store client
* Add Object API library in openstackclient.object.v1.lib
* Add Object API {container,object} list commands
* Add library tests
* Add command tests
This should complete the Object v1 container and object list commands
Change-Id: Ib1770d45efa8871959826b85faafa1e0bcef0a03
* establish the the form of cliff command classes
* implement some common fake objects
* implement Identity command tests for v2 project
* fix stdout/stderr capture
Also re-work the project create and set commands for exclusive options
(--enable|--disable) to actually behave properly. Yay tests!
Change-Id: Icbb313db544c1f8dd3c9af7709971838b5a4d115