186 Commits

Author SHA1 Message Date
Terry Howe
b638488697 Domain administrator cannot do project operations
Domain administrator cannot do project operations because the
require access to the domain API (which they don't have).  When
attempting to find a domain for project operations, ignore errors
because the API returns nothing without indicating there is a
problem.  The domain administrators will have to use a domain id,
but they will still be able to do project operations.  If the user
does not have permission to read the domain table, they cannot
use domain names.

Change-Id: Ieed5d420022a407c8296a0bb3569d9469c89d752
Closes-Bug: #1317478
Closes-Bug: #1317485
2014-07-07 20:18:39 +00:00
Terry Howe
fba951568c Python 3: do not compare a list to a zip object
In Python 3, zip() returns a zip object, not a list.

Change-Id: I1a472bec3e12b5ae3c3555cf690b99a57579ce83
2014-07-07 09:11:57 -06:00
Terry Howe
a065dd09e4 Allow network find to use alternate name
Add the name_attr to the network find method so it can search
for things like floating_ip_address for floating IP addresses
rather than just id.

Change-Id: I827e3745b06397a54555d1286e477bf2e05bf789
2014-07-07 06:11:58 -06:00
Terry Howe
b157dc937e Move network stuff to v2 instead of v2_0
Rename network stuff v2

Change-Id: Ia9b8feda20dfd35b0f3712b8e2419d0bf5da0acd
2014-07-07 06:08:02 -06:00
Terry Howe
79488377eb Catch SystemExit for parse args
If you have a test with parse args it fails with no error
messages.  This change throws an exception.

Change-Id: I545aba346620a352fe570d394dbd4d6bd2daa995
2014-07-06 10:02:51 -06:00
Jenkins
7f59fa5943 Merge "trust authentication" 2014-07-04 00:44:51 +00:00
Jenkins
e43c0f2b9b Merge "Python 3: do not use __builtin__" 2014-07-03 17:13:53 +00:00
Matthieu Huin
5672c688d1 trust authentication
This patch enables authenticating by using a trust. The trust ID
must be set with the parameter --os-trust-id or the env variable
OS_TRUST_ID. Trusts are available for the identity v3 API.

Co-Authored-By: Florent Flament <florent.flament@cloudwatt.com>
Change-Id: Iacc389b203bbadda53ca31a7f5a9b8b6e1a1f522
2014-07-03 10:12:02 +02:00
Cyril Roelandt
169587ddbd Python 3: do not use __builtin__
Use six.moves.builtins instead, this works with both Python 2 and 3.

Change-Id: I57e7257d4f06c805f26383e0778ad104d50ea139
2014-07-03 00:27:35 +02:00
Steve Martinelli
3bdfef827c Remove backslash usage from a few tests
Noticed these in the code, figured we should stick to not using
backslashes if possible.

Change-Id: I55e5402683141e14df7c2b38883b1f3cc2a6bb6a
2014-07-02 00:00:33 -04:00
Jenkins
ddf0c16a10 Merge "Fix PEP8 E126 and E202 errors" 2014-06-27 21:41:34 +00:00
Jenkins
58583b55ca Merge "Fix PEP8 E265 errors" 2014-06-27 21:41:33 +00:00
Jenkins
63b1c06024 Merge "Fix PEP8 H405 errors" 2014-06-27 21:41:31 +00:00
Dean Troyer
1fca946890 Rename token classes to match command
The token create/delete commands were renamed but not the class names.
Rename them to match.

Change-Id: Icbf9c0a954ed0332fa4c99e4ee2612bb11f89e3a
2014-06-27 09:14:58 -05:00
Dean Troyer
4914a8d107 Fix PEP8 E126 and E202 errors
Do both as they are all in the same set of files that required
major re-formatting.

Change-Id: I6e8a8ce19a55105124a33c0e2487fc4b4e06d252
2014-06-27 09:12:55 -05:00
Dean Troyer
11f3654f6e Fix PEP8 E265 errors
Change-Id: Ieb9a9af1da27d3935d1a4d3cfb61b0ccb03d099a
2014-06-27 09:12:55 -05:00
Dean Troyer
a78d75f290 Fix PEP8 H405 errors
Change-Id: Id9ea03e7d88148f84bffe1b18b5b4315e6123012
2014-06-27 09:12:38 -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
Dean Troyer
9dd3a5326c Complete Identity v3 list command filters
Complete the 'group list' and 'user list' filter options following
the refactor in https://review.openstack.org/69878

Change-Id: Ib4af417c56d4f7da4b88852f191af615cc7fa2ec
2014-06-19 13:00:02 -05:00
Jenkins
c6cc1d72d5 Merge "Refactor role list subcommand for identity v3 api" 2014-06-19 17:14:03 +00:00
Jenkins
1f2189d6de Merge "Add token delete command for identity v2" 2014-06-18 15:37:40 +00:00
Terry Howe
0b2987fef3 Fix find_resource for keystone and cinder
The find_resource method had two hacks in in to support cinder
and keystone and I have removed those in favor of a monkey patch
for cinder.

The find_resource method used to attempt to UUID parse the id, but
it would do a manager.get anyway.  I changed it to skip the UUID
parsing.  This will make things run minorly faster and it supports
LDAP for keystone.

The find_resource used to attempt to use display_name=name_or_id
when finding.  This was a hack for cinder support, but it breaks
keystone because keystone totally messes up with the bogus filter
and keystone refuses to fix it.

Change-Id: I66e45a6341f704900f1d5321a0e70eac3d051665
Closes-Bug: #1306699
2014-06-17 10:24:26 -06:00
Dean Troyer
6380b8b959 Image create and set command updates and tests
Refactor image create and set commands to properly handle properties.
This is particularly tricky with exclusive booleans as in this case leaving
both choices off the command line should NOT assume a default value but
leave the existing value unchanged.

Properties were not being updated correctly in the 'image set' command.
Refactor it to use the same pattern as in other SetXxx commands.
Add tests for arg handling.

Change-Id: I123a64c9b4feecab25a3e2013cc047f55b1c9967
2014-06-16 23:30:46 -04:00
Steve Martinelli
d5aaba9d82 Refactor oauth1 code for updates
The keystoneclient code for oauth1 support has changed.
As such, we should remove the delete, list and authenticate
functions, since they are not in keystoneclient.

Also, we must now pass in the project id when creating a
request token. Additionally we must now pass in roles
when authorizing a request token.

Added functional tests to ensure output and input args
are the same.

bp add-oauth-support
Change-Id: I559c18a73ad95a0c8b7a6a95f463b78334186f61
2014-06-14 17:21:17 -04:00
Jenkins
0da5bfe428 Merge "Ignore most of the new hacking 0.9.2 rules" 2014-06-14 18:37:12 +00:00
Jenkins
99e7660d56 Merge "Add support for extension list" 2014-06-14 06:25:38 +00:00
Dean Troyer
0059f045a9 Ignore most of the new hacking 0.9.2 rules
So we can update requriements.txt.  But fix a couple of easy ones:
* Fix E251 (1 occurrance)
* Fix E131 (1 occurrance)

Change-Id: I62aaa423aa6da9e9f0ca026ec586b51cc6a6df03
2014-06-13 17:06:28 -05:00
Jenkins
497a38903c Merge "Add role assignments list support to identity v3" 2014-06-13 20:56:27 +00:00
Qiu Yu
f78a3f1653 Refactor role list subcommand for identity v3 api
Currently parts of user list and group list command are actually
functioning as role listing, which is quite counter intuitive and
misleading.

This refactor change move role related logic to a single place of role
list command. It now allows role grants listing for user/group +
domain/project combinations.

If no user or group specified, it will list all roles in the system,
which is the default behaviour.

Change-Id: I4ced6df4b76f018d01000d28b4281ad9f252ffcc
2014-06-13 15:20:42 -05:00
Matt Fischer
4ae4dc35bd Add support for extension list
- Add support in the common section for extension list. This only
   supports Identity for now. Once the APIs for volume and compute
   are supported in the respective APIs, they will be added. Once
   network is added to this client, it will be added (the API already
   supports it).
 - Include extension fakes for volume and compute for pre-enablement.

Change-Id: Iebb0156a779887d2ab06488a2a27b70b56369376
Closes-Bug: #1319115
2014-06-11 13:40:30 -06:00
Jenkins
7f6a901d01 Merge "Add tests for identity endpoints" 2014-06-10 02:27:55 +00:00
henriquetruta
58f80e4c75 Add role assignments list support to identity v3
The assignments manager and its test class were created.
Some fake stubs were also added on the fakes.py module.

The "openstack role assignment list" command was created.

Change-Id: Iae94f4fee608ea3e09ff38961ad22edc38efb89c
Implements: blueprint roles-assignment-list
Closes-Bug: 1246310
2014-05-30 15:55:24 -03:00
Jenkins
fb65652753 Merge "Fixed several typos throughout the codebase" 2014-05-28 23:05:54 +00:00
Jenkins
7ceff0eafc Merge "Fix server image create" 2014-05-28 22:05:53 +00:00
Terry Howe
d6321c0893 Add token delete command for identity v2
Identity v2 has undocumented support for token delete and
keystoneclient also has support.

Change-Id: Ib98d17958ceb88f7b63471691dee71fdb884ce2e
Closes-Bug: #1318442
2014-05-23 10:17:42 -06:00
Alex Gaynor
a8087a6c8b Fixed several typos throughout the codebase
Change-Id: I048ee857fc1215fea7f60978364894e1b5abdf66
2014-05-21 07:47:52 -07:00
Matt Fischer
dc44ec1ddf Add tests for identity endpoints
Change-Id: If15cc74fafbbe52fa86aa353f2598aa31daf0695
Closes-Bug: #1319450
2014-05-15 12:20:30 -04:00
Dean Troyer
870e7ddbcc Change volume create --volume-type to --type
This makes it consistent with the other --type options in OSC.  Also
add a few more volume_create tests.

Change-Id: I50ef927932cabf157ecdfd6c4faa1914b4fdf413
2014-05-15 09:25:07 -05:00
Jenkins
a93851d6af Merge "Implement CRUD operations for Identity Providers" 2014-05-09 21:38:20 +00:00
Dean Troyer
da5e31dbb6 Fix server image create
The final find_resource() call errored because servers.create_image()
returns an image ID rather than an Image resource.  Reset expectations
and arguments.

Change-Id: I1b9132f66091f9df76198724156acb7a6fb2f6fe
2014-05-08 15:04:22 -05:00
Marek Denis
ef9496a4fc Implement CRUD operations for Identity Providers
Operations for:
    * adding Identity Provider
    * listing Identity Providers
    * showing Identity Provider
    * updating Identity Provider
    * deleting Identity Provider

Change-Id: I4557168309f93e4670116b5c3c0e29252ff0c40f
Implements: bp/add-openstackclient-federation-crud
2014-04-24 14:55:54 +02:00
Jenkins
845f6705bf Merge "Fix the project option to user list so it filters" 2014-04-23 23:11:48 +00:00
Jamie Lennox
022b6d95d1 Pass arguments to v3 keystoneclient by kwarg
Keystoneclient has added the positional decorator which emits a warning
if arguments aren't passed by keyword. This means we are getting
warnings in certain places in openstackclient.

Change-Id: Ic5446cd6f122cbb56fce543011386d53bc31fe18
Closes-Bug: #1302199
2014-04-04 08:09:43 +10:00
Terry Howe
e72072adc3 Fix the project option to user list so it filters
The --project option to the user list command was not implemented
* Allow users to be filted by project
* Support id or name of project with the find_resource command
* Make sure the report does not contain duplicates

Change-Id: Ic0e10cccd7749d38a7d4b80bbdc68e61a660084b
Closes-Bug: #1177255
2014-04-01 09:03:45 -06:00
Terry Howe
4900c64d09 Produce a useful error message for NoUniqueMatch
Most of the CLIs use a NoUniqueMatch, so produce a useful
error message if that happens.  Added some tests for
find_resource as well.

Change-Id: I85ba61d5f6d1be5bd336a1cc4b02501492905f33
Closes-Bug: #1293846
2014-03-17 17:32:41 -06:00
Steven Hardy
0c0803d363 identity v3 allow project list filtering by domain
The underlying keystoneclient interface allows filtering by domain,
so support it in the cli interface because it makes project list
much nicer to use in a multi-domain deployment.

Change-Id: If3f5cf1205c1e9cf314f8286a3ae81bda4456b8f
Closes-Bug: #1289513
2014-03-13 09:32:21 +00:00
Jenkins
ce63fa0121 Merge "Add ability to set key value pairs in projects" 2014-03-13 06:33:24 +00:00
Terry Howe
70e6333e7d Add ability to set key value pairs in projects
Add supporto of extra key value pairs for projects (aka tenants)
* Added option --property key=value to create and set commands
* Support for versions v2 and v3

Change-Id: I84064b8b308579d1b66c83b1ed3d1a37614ec087
Closes-Bug: #1220280
2014-03-06 14:22:17 -07:00
Terry Howe
e6e0dbf754 Add --volume option to image create command
Add ability to create an image from a volume.
* Added --volume command to image create
* Added --force option to image create
* Added block to access volume manager in image create
* Tests added for the volume option

Change-Id: I3910a2b5e04acd0d15dd230747ba6ebca07aa316
Closes-Bug: #1207615
2014-03-05 11:26:13 -07:00
Jenkins
034a9d158f Merge "Add ability to prompt for passwords for user create and set" 2014-02-22 06:00:18 +00:00