670 Commits

Author SHA1 Message Date
Monty Taylor
3af547a1a6 Fix operation on clouds with availability-zones
In a cloud with AZs, you can get multiple entries back from the service
catalog - one for each AZ and then one that is AZ agnostic that's tied
to the region. If the region_name is plumbed all the way through, this
works as intended.

Change-Id: I3b365ea306e8111fc80830672ae8080a5d1dc8e0
2014-10-11 14:30:04 -07:00
Nathan Kinder
f0c57e17c9 Allow --domain to be used for identity commands without lookup
Performing create, list, or set operations for users, groups, and projects
with the --domain option attempts to look up the domain for name to ID
conversion.  In the case of an environment using Keystone domains, it is
desired to allow a domain admin to perform these operations for objects in
their domain without allowing them to list or show domains. The current
behavior prevents the domain admin from performing these operations since
they will be forbidden to perform the underlying list_domains operation.

This patch makes the domain lookup error a soft failure, and falls back
to using the passed in domain argument directly as a domain ID in the
request that it sends to Keystone.

Change-Id: I5139097f8cedc53693f6f71297518917ac72e50a
Closes-Bug: #1378565
2014-10-09 13:29:21 -07:00
Steve Martinelli
b61db3eb72 Add translation markers for user v2 actions
implements bp use_i18n

Change-Id: I86508a232c9cf88695b7982dad0b9b02eaf8b3a1
2014-10-09 14:47:19 -04:00
Steve Martinelli
364071a90b Add domain parameters to user show for Identity V3
Update `user show` for Identity V3 to account for a domain argument,
in doing so, also update `find resource` to be more flexible by
allowing **kwargs.
Also update `group show` and `project show` since they follow the
same logic as a user within a group.

Change-Id: Ib828e4dbeb0bd31164396069ce8a64c873179779
Closes-Bug: #1378165
2014-10-09 14:34:48 -04:00
Steve Martinelli
bb71df9ced Mark identity v2 resources for translation
mark v2 catalog, ec2, endpoint, project, role, service and token

Change-Id: I14a5852bfee4ca9e25130d001fdadd7778ad0996
2014-10-09 14:16:45 -04: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
Jenkins
866965f011 Merge "Update for cliff commandmanager >=1.6.1" 2014-10-09 04:43:01 +00:00
Jenkins
8554fd24fe Merge "CRUD operations for federated protocols" 2014-10-09 03:59:33 +00:00
Jenkins
d87868720e Merge "Pass in domain and project as positional args, not kwargs" 2014-10-09 03:23:03 +00:00
Dean Troyer
d32185cb34 Add 'command list' command
* Add method to CommandManager to retrieve command names by group
* Add ListCommands

To list command groups loaded by cliff

Change-Id: I37fe2471aa2fafa8aa223159452d52b1981021d6
2014-10-08 21:57:26 -05:00
Marek Denis
14c61a0ace CRUD operations for federated protocols
Openstackclient needs to have a capability to manage federated protocols
(like saml2, openid connect, abfab). This patch allows users to
administrate such operations from the commandline.

Change-Id: I59eef2acdda60c7ec795d1bfe31e8e960b4478a1
Implements: bp/add-openstackclient-federation-crud
2014-10-08 21:12:38 -04:00
Dean Troyer
5b6c24fdb0 Update for cliff commandmanager >=1.6.1
Cliff 1.6.1 added  CommandManager.load_commands() so we can adopt it
rather than rolling our own.

Also, that second group is Greek, not Latin.  Jeez...

Change-Id: I4a63c22f37bcfd0ef5d83c2dbd08b58fda0db35c
2014-10-08 18:05:43 -05:00
Jenkins
d405b1b12d Merge "Fix issues with object related commands" 2014-10-08 22:18:50 +00:00
Jenkins
35b0bbd762 Merge "Implement CRUD operations for Mapping objects" 2014-10-08 22:17:56 +00:00
Steve Martinelli
111d43ad8f Update compute server messages for translation
Mark some of the messages from the server for translation

implements bp use_i18n

Change-Id: I503efcfb4ca3dec1c427b58ee4a85de9a241dacd
2014-10-08 15:05:22 -04:00
Marek Denis
30b0a41ce7 Implement CRUD operations for Mapping objects
Change-Id: I4b8f2e77e741cf74f50aba98ab975af7321b02c6
Implements: bp/add-openstackclient-federation-crud
2014-10-08 18:35:11 +02:00
Steve Martinelli
388bbbac2c Fix issues with object related commands
1) Can't create instance of swiftclient. Since we now create
an API instance, creating a swiftclient instance won't work.
Trying to do any object related command fails.

2) Listing objects in a container fails, we depend on the
data returned in a specific way, during the API transition
this must have slipped through.

Needs regression/funcitonal tests to mame sure this doesn't
happen again.

Change-Id: I69079a0dc9f32b84e6f9307729d3dbbba549ac5e
2014-10-06 20:04:19 -04:00
Steve Martinelli
0cb204e59b Update gitignore
add .project and .pydevproject to gitignore

Change-Id: Ic258ded80612d31bd3017fce65000b619026e844
2014-10-03 19:35:13 -04:00
Jenkins
5c8b43e891 Merge "Remove duplicate env function in shell.py" 2014-10-03 22:38:14 +00:00
Jenkins
af04ff5ba3 Merge "Create a whole slew of functional tests for identity" 2014-10-03 22:38:08 +00:00
Jenkins
89a58c65ca Merge "Add functional tests to osc" 2014-10-03 22:38:01 +00:00
Jenkins
86d258f658 Merge "Add some code-blocks to the docs" 2014-10-03 22:36:19 +00:00
Steve Martinelli
89bb5b0b85 Add some code-blocks to the docs
Add some basic highlighting for the docs

Change-Id: Ifa740856f3ef636bdf0f60f3b7d082c68062fe9b
2014-10-03 00:25:56 -04:00
Steve Martinelli
1934b1b243 Place the command to generate docs on one line
Change-Id: I99d78208c940bc6646327ee967e71187c32a159f
2014-10-03 00:09:59 -04:00
Steve Martinelli
693687e4ff Remove duplicate env function in shell.py
There already exists an env() function in utils. Let's use that
one since it's common.

Change-Id: I661984394cf0c0543b2f35bf76e3929dead54d1d
2014-10-02 23:09:34 -04:00
Steve Martinelli
d972b8364c Pass in domain and project as positional args, not kwargs
The signature for users.set in keystoneclient dictates that
domain and project be sent in, not domainId and projectId,
which are being incorrectly sent in as 'extra' data.

Closes-Bug: #1376833

Change-Id: I44df3e492f61eab2241f3758dee622417bb6f399
2014-10-02 14:32:12 -04:00
Steve Martinelli
3842960f71 Create a whole slew of functional tests for identity
Complete the remaining identity v2 and v3 functional tests

Change-Id: I193fd95e58a38caeb66d37c17cde75b983c48ca0
2014-10-01 21:33:43 -04:00
Steve Martinelli
742982af4b Add functional tests to osc
Create a script that kicks off function tests that exercise
openstackclient commands against a cloud.

If no keystone/openstack process is detected, a devstack instance
is spun up and the tests are run against that.

There is also a hook added to tox.ini so that we can run these
tests easily from a gate job.

Change-Id: I3cc8b2b800de7ca74af506d2c7e8ee481fa985f0
2014-10-01 19:46:07 -04:00
Dean Troyer
31018bf7c2 Move object-store commands to low-level API
api.object_store.APIv1 now contains the formerly top-level functions
implementing the object-store REST client. This replaces the old-style
ObjectClientv1 that is no longer necessary.

Change-Id: I7d8fea326b214481e7d6b24119bd41777c6aa968
2014-10-01 13:50:13 -04:00
Dean Troyer
e3b9b96588 Add low-level API base class
Adds the foundation of a low-level REST API client.  This is the final prep
stage in the conversion of the object-store commands from the old restapi
interface to the keystoneclient.session-based API.

* api.api.BaseAPI holds the common operations

Change-Id: I8fba980e3eb2d787344f766507a9d0dae49dcadf
2014-09-29 12:32:45 -05: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
Jenkins
02320a5a24 Merge "Updated from global requirements" 2014-09-28 07:42:34 +00:00
Jenkins
48bb39f299 Merge "utils.find_resource does not catch right exception" 2014-09-28 07:39:19 +00:00
OpenStack Proposal Bot
3ddd4e2646 Updated from global requirements
Change-Id: I2a8250d0b01651563cfe74704ce5a9f97dd9fdf4
2014-09-25 19:08:05 +00:00
wanghong
7029cf37e2 utils.find_resource does not catch right exception
Currently, utils.find_resource catch NotFound exception defined in
openstackclient. However, different client libraries raise different
exceptions defined in thire own library.

Change-Id: Idc40428e30e59f71dbdbfa0555c0066fddc441c2
Closes-Bug: #1371924
2014-09-24 11:04:41 +08:00
Steve Martinelli
1212ddb431 Remove unused reference to keyring
There's a unnecessary reference that is not being used.

Change-Id: I5ac85d2331385e4a31970b63fd17e650f82046ca
2014-09-23 16:43:31 -04:00
wanghong
2d1225624c v3 credential set always needs --user option
Change-Id: Ieca76bb6ee2f328f4e33010623c25eb9c18e6952
Closes-Bug: #1372744
2014-09-23 14:52:44 +08:00
Oleksii Chuprykov
ffe976ce3e Use oslo.utils
Module `importutils` from common code was graduated to oslo.utils,
so it would be great if we reuse this library.
Remove unused strutils.py and gettextutils.py

Change-Id: Iaae19fc5018d83103e5f15ff76d6da686bfdf5f8
2014-09-22 13:07:31 +03:00
Jenkins
ceae0bed42 Merge "Fixing typo and improving docstring of find_domain" 2014-09-22 07:01:33 +00:00
Steve Martinelli
c8b3f23733 Change help text for image save command
Change-Id: Ib2aecb68ffa06f9ac831131944c98c49cf99c75a
Closes-Bug: #1372070
2014-09-21 12:02:11 -04:00
Victor Silva
bfff44fc17 Fixing typo and improving docstring of find_domain
This should make it easier to understand the
purpose of find_domain - I believe the reason
for which find_resource wasn't enough was not
quite clear.

Change-Id: I6a1cdfa86f52401d95c6da2cd38d7c95a140b4a1
2014-09-19 19:51:01 +00:00
OpenStack Proposal Bot
2a2c8eec26 Updated from global requirements
Change-Id: I744a629cf685760ad96d60654d081fc495024ea8
2014-09-19 08:51:38 +00:00
Jenkins
d3bee31a9d Merge "Acknowlege git.o.o as OpenStack's git server" 2014-09-19 04:31:22 +00:00
Jenkins
0ee7073170 Merge "Add service catalog commands" 2014-09-19 02:42:55 +00:00
Anita Kuno
92add18e31 Acknowlege git.o.o as OpenStack's git server
OpenStack's cannonical git server is at git.o.o this patch
updates the index.rst to reflect that.

Change-Id: I54eeea7fab2e0f64ca9f23f7c328e2ff19721a41
2014-09-18 17:06:29 -04:00
Dean Troyer
da45b34828 Add service catalog commands
'catalog list' and 'catalog show' for Identity v2

Identity v2 only so far.

Change-Id: I9df0dac3d5bb7c18f38a81bd7d29f8119462d3a5
2014-09-18 15:42:10 -05:00
Jenkins
873ece1cf7 Merge "Return current user/project for user/project show commands" 2014-09-18 09:44:48 +00:00
Jenkins
df69d3264f Merge "Add network extension list" 2014-09-18 09:41:51 +00:00
Jenkins
2306059c8e Merge "Multiple args for object and container commands" 2014-09-18 08:17:14 +00:00
Jenkins
8d37e66cb2 Merge "Add support for 'file' format objects" 2014-09-18 07:26:45 +00:00