18 Commits

Author SHA1 Message Date
Steve Martinelli
b17c475f8a Upgrade hacking to 0.10
Also resolve the only error that was produced.

Change-Id: Ic81ab01aa0cddc15bb27419d7fec3e5a6d4ec0c7
2015-01-12 15:22:39 -05:00
Jenkins
89f485f605 Merge "Use fixtures from keystoneclient for static data" 2014-11-12 21:54:07 +00:00
Dean Troyer
42d0b20ebc Add --or-show option to user create
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
2014-11-07 12:28:42 -06:00
Jamie Lennox
b193793636 Use fixtures from keystoneclient for static data
We should use the fixture generation code from keystoneclient rather
than keep our own copies of the token and discovery structure.

Change-Id: I53c1d2935d1d65c39b8abea89427af2fc3edd181
2014-10-31 15:15:54 +01:00
Matthieu Huin
631ed3c802 Unscoped federated user-specific commands
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>
2014-10-30 17:27:28 +01:00
Matthieu Huin
0c77a9fe8b Support for keystone auth plugins
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>
2014-10-09 12:34:47 +02:00
Dean Troyer
207c8cf3ef Test top-to-bottom: object-store containers
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
2014-09-29 00:02:32 -05:00
Dean Troyer
4bbd03210f Change app.restapi to app.client_manager.session
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
2014-08-25 13:38:03 -05:00
Terry Howe
8f59524c3e Network CRUD
bp/neutron
https://wiki.openstack.org/wiki/OpenStackClient/Commands#Network_2

Change-Id: I89ee083154afa544b03587e84becace36d9d522a
2014-06-24 15:00:25 -06:00
Cyril Roelandt
3a5abf743c Use six.iteritems() rather than dict.iteritems()
This is compatible with both Python 2 and 3.

Change-Id: I6fe3e9bf9ece699badbdb9933118af90642a91e9
2014-02-11 02:53:24 +01:00
Jenkins
b88a7b8ccc Merge "Add module list command" 2013-12-05 23:34:31 +00:00
Dean Troyer
a93cc3fae2 Add module list command
Lists versions of installed python modules

(Origianlly proposed as 'version list')

Change-Id: I76a51d3d6783f46ef2daa0a41626019a880a2a50
2013-12-03 17:53:55 -06:00
Dean Troyer
9062811d10 Expand support for command extensions
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
2013-11-21 01:27:10 -06:00
Dean Troyer
6460f1eb35 Complete basic test infrastructure
This finally gets all of the API tests into a common framework regarding
test classes and so forth.

Change-Id: If675347129c50dcba0bfc5b6c58f5a2ca57ff46c
2013-11-18 22:11:10 -06:00
Dean Troyer
7a0a7d67ed Prepare for Identity v3 tests
* 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
2013-09-09 14:52:50 -05:00
Dean Troyer
eb405a88c4 Refactor fake data for projects and users
* Move fake data structures into tests/identity/fakes.py
* Use fake clients correctly and support multiple client versions

Change-Id: Icacbb2ca740b63937bd2c4442af61b620638b53e
2013-09-04 14:48:24 -05:00
Dean Troyer
725e2543ef Object API commands using our REST API layer
* 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
2013-08-28 22:16:34 -05:00
Dean Troyer
493339d4da Add Identity v2 project tests
* 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
2013-08-16 14:35:46 -05:00