356 Commits

Author SHA1 Message Date
Jenkins
ffb232a90e Merge "Correct reraising of exception" 2016-07-07 20:56:18 +00:00
Jenkins
2adeac2bc2 Merge "osc-lib: api.auth" 2016-07-07 19:49:06 +00:00
qinchunhua
6f36385cb8 Correct reraising of exception
When an exception was caught and rethrown,
it should call 'raise' without any arguments
because it shows the place where an exception
occured initially instead of place where the exception re-raised.

Change-Id: I5fb6dea5da7fb6e1e2b339a713c7d37f8c99e407
2016-07-07 15:05:58 +00:00
Dean Troyer
d324530532 osc-lib: api.auth
Move auth plugin checking to osc-lib.

Change-Id: I673d9c2d6e8bbf724c3000459a729e831d747814
2016-06-30 08:57:59 -05:00
sunyajing
6df09fd377 Support multi-delete for commands in identity V2
Commands are "ec2 credentials delete", "service delete", "endpoint delete".
Also update their unit tests and functional tests.

Partial-Bug: #1592906
Change-Id: I1a0b7160b803a523646d09d030e6f112c81c4c24
2016-06-23 23:57:49 -04:00
Jenkins
b7909252a5 Merge "Use resource id when name given for identity show" 2016-06-23 17:14:02 +00:00
sunyajing
e8483c9022 Standardize logger usage of catalog in identity
Change-Id: I5307f949b3a350e41840a4a5c191ceacf1b3b291
Partially-Implements: blueprint log-usage
2016-06-23 08:22:51 +00:00
David Rosales
337d013c94 Use resource id when name given for identity show
Currently a user is allowed to specify either a resource ID or name
when running openstack identity comands. In some cases, when a name
is specified instead of an ID, the command will return as not able
to find the resource when it in fact does exist.

The changes here are to check the client against the token on such
requests and to extract the ID of the resource specified if enough
information exists between the two. We then use the ID associated
with the resource to complete the user requests.

Change-Id: I40713b0ded42063b786dc21247e854224b9d2fe2
Closes-Bug: #1561599
2016-06-22 21:55:46 -07:00
Jenkins
f5ae23ab86 Merge "Standardize logger usage" 2016-06-20 17:26:57 +00:00
Tang Chen
047cb68493 Standardize logger usage
Use file logger for all command specific logs.

This patch also fixes some usage that doesn't
follow rules in:
http://docs.openstack.org/developer/oslo.i18n/guidelines.html

After this patch, all self.log and self.app.log
will be standardized to LOG().

NOTE: In shell.py, we got the log in class OpenStackShell,
      which is also known as self.app.log in other classes.
      This logger is used to record non-command-specific logs.
      So we leave it as-is.

Change-Id: I114f73ee6c7e84593d71e724bc1ad00d343c1896
Implements: blueprint log-usage
2016-06-20 15:16:51 +00:00
sunyajing
6dbe911800 Modify help msg and docs in identity
Migrate 'change', 'update' to 'modify',
migrate 'user to delete' to 'user(s) to delete',
migrate '(name or ID)' to '(type, name or ID)'.

Change-Id: Ie425e178bb5ddf773e6e793fcd91c78e9c4a5053
2016-06-17 09:41:39 +00:00
Jenkins
1464c8a237 Merge "Make set/unset command in identity and image pass normally when nothing specified" 2016-06-17 06:24:35 +00:00
sunyajing
8a12a39ece Make set/unset command in identity and image pass normally when nothing specified
Also update its unit tests.

Change-Id: I82b90658b0d4247cdc9a650f14aceda640a32059
Partial-bug: #1588588
2016-06-17 04:20:28 +00:00
Jenkins
b5e524ac84 Merge "Fix help msg of identity endpoint" 2016-06-16 12:43:32 +00:00
sunyajing
9eb77ae1de Fix help msg of identity endpoint
<service> argument of `endpoint create` command doesn't mean
`new endpoint service`, but an existent service that the new endpoint attached to.

Change-Id: I846fdb501bdea14499f42288186f375a3b2b5951
2016-06-16 09:55:10 +08:00
Jenkins
2c92b60f45 Merge "osc-lib: command" 2016-06-14 06:45:17 +00:00
Jenkins
287fe3610a Merge "osc-lib: parseractions" 2016-06-14 04:22:03 +00:00
Tang Chen
304f565439 Fix i18n problems for common files in identity
Some missing parts in identity.

Change-Id: I8777b845613d7d7df36ac3c198da552e11aaad1b
Partial-bug: #1574965
2016-06-14 09:50:23 +08:00
Dean Troyer
9e2b8e6730 osc-lib: command
Leave command.py and test_command.py as a sanity check during the
deprecation period.

Change-Id: I24e1b755cbfbcbcaeb5273ec0c9706b82384fc85
2016-06-13 11:00:22 -05:00
Dean Troyer
be192676bd osc-lib: parseractions
Leave parseractions.py and test_parseractions.py as a sanity check during the
deprecation period.

Change-Id: I1a7469b6d872284e0276502a1a287bc0b87f8f83
2016-06-13 10:55:44 -05:00
Dean Troyer
e5e29a8fef osc-lib: utils
Use osc-lib directly for utils.

Leave openstackclient.common.utils for deprecation period.

Change-Id: I5bd9579abc4e07f45219ccd0565626e6667472f7
2016-06-13 10:50:44 -05:00
Dean Troyer
d20c863ebc osc-lib: exceptions
Use osc-lib directly for exceptions.

Leave openstackclient.common.exceptions for deprecation period.

Change-Id: Iea3e862302372e1b31ccd27f69db59b4953ca828
2016-06-13 10:50:01 -05:00
Navid Pustchi
6ae0d2e8a5 Moving authentication from keystoneclient to keystoneauth
Currently OpenStackClient uses keystoneclient for authentication.
This change will update OpenStackClient to use keystoneauth for
authentication.

All dependant test have been updated.

Updating how auth_ref is set in the tests to use KSA fixtures had
some racy side-effects.  The user_role_list tests failed when they
picked up an auth_ref that was a fixture.  This exposed a weakness
in ListUserRole that needed to be fixed at the same time re
handling of unscoped tokens and options.

Change-Id: I4ddb2dbbb3bf2ab37494468eaf65cef9213a6e00
Closes-Bug: 1533369
2016-06-09 18:00:40 +02:00
Tang Chen
5293bb103e Fix i18n support problems in identity
Change-Id: I3b48d17850343051239b5b69e8b890dba32d3ac8
Partial-bug: #1574965
2016-06-07 09:37:02 +08:00
Lu lei
54e81a9984 Add newline to strings in stdout/stderr.write()
Function stdout/stderr.write() can't break line automatically.

Change-Id: I903c2d1cc1a669adb6be5aa4eb783d3b9943e685
2016-06-06 13:54:55 +08:00
Dean Troyer
41f5521ee9 Update v2 endpoint show help
https://review.openstack.org/#/c/319821/ updated v2 endpoint show
and the doc, but not the v3 help.

Change-Id: Ifaa90f6266eabafb9de544199759f4ee8bcc1c83
2016-06-02 14:32:16 -05:00
Alvaro Lopez Garcia
5f950788ff Do not require an scope when setting a password
Changing the password in Keystone V3 is an unscoped operation, but we
were requiring a scope.

Change-Id: If0653ac7b59320c2cd9d42a2c73dd29c3626d389
Closes-Bug: 1543222
2016-05-27 09:12:24 +02:00
Jenkins
9da02d14ea Merge "fix endpoint show help" 2016-05-26 22:10:23 +00:00
sunyajing
9e9e4e6f59 fix endpoint show help
endpoint show command can also work on service name or type or ID option

Change-Id: I43c8df4bc093d4130cf33fd2520736ce9077dc82
2016-05-26 19:40:26 +08:00
Jenkins
0d8dab6288 Merge "keystone: fix catalog output when region is unset" 2016-05-25 18:56:14 +00:00
Julien Danjou
e44bb009d3 keystone: fix catalog output when region is unset
If no region is set in Keystone, null is deserialized as None and the
region has None has value, which triggers a type error when building the
output string.

This patch fixes that.

Change-Id: I7637dc2595655cf452f38308f99fe66ac782e16d
2016-05-25 16:13:48 +02:00
Jenkins
f97fa2e6d2 Merge "Search by user defined ID for service providers" 2016-05-25 02:44:56 +00:00
Steve Martinelli
58094bff80 Search by user defined ID for service providers
IDs for service providers can be user defined (like, Bob). This
causes issues with the usual get by ID method.

Keystone server side has implemented changes to search by ID when
listing, which should resolve the issue with minimal changes to
the client side.

Change-Id: Ic705806e4bc7bb24f946a1fce803a0a0a4d788c1
Closes-Bug: 1555830
2016-05-24 18:45:58 +00:00
Steve Martinelli
21530d026e Search by user defined ID for identity providers
IDs for service providers can be user defined (like, Bob). This
causes issues with the usual get by ID method.

Keystone server side has implemented changes to search by ID when
listing, which should resolve the issue with minimal changes to
the client side.

Change-Id: Ic58df22b3445d3293a8e1c76c5da79badebf6528
Closes-Bug: 1479837
2016-05-23 15:18:11 -04:00
Steve Martinelli
ebcbd6ba71 remove #noqa from i18n imports
hacking checks no longer fail on `import _`

Change-Id: Idd60f0a0e71e5081691eacb39e5091ab08fcce6d
2016-05-13 13:14:02 -07:00
sharat.sharma
f924fa39e1 Added "name" parameter to the help message.
In OS_IDENTITY_API_VERSION=3, the "openstack help service delete"
allows the user to remove a service based on the name of the
service. So, this patch includes name as positional argument.

Change-Id: Iae7cb0a82af3cdd4d88e0ed2eb651abf9af30fd9
Closes-Bug: #1566909
2016-05-04 12:57:07 +00:00
Tang Chen
32c627eaf0 Doc: Unify repeatable option comments
There are lots of "this option can be repeated" comments
in the doc, which are not consistent to other similar
docs.

This patch changes them to the following format:

"repeat option to do something"

Change-Id: I54e01053091c428bf87bb36bb95f73a0b80ab6e7
2016-04-12 15:57:17 +08:00
timothy-symanczyk
15edb2f61a Improve error for token issue command without auth
Currently when you perform the 'token issue' command with
the admin_token, the error is a nonsense python error. This
commit changes it to be user-friendly.

Change-Id: I5cc92c342e3f83e099354cd04301c7b8d8d2dabc
Closes-Bug: #1547721
2016-03-18 15:44:02 -07:00
Tang Chen
fc24f37ae2 Trivial: Remove useless return
If a function returns nothing, do not add return in the end.

Change-Id: I298b8717462f68d3076a1619d674775be2a94c42
2016-03-07 17:54:06 +08:00
Mohan Muppidi
3d7430463c take_action() method from command.Command shouldn't return
command.Command and command.Showone are base classes implemented
in cliff framework. Showone extends Command to allow take_action()
to return data to be formatted using a user-selectable formatter.
Most of the classes which are extended from Command in
openstackclient/identity/v3/ in some cases return data or return
nothing where it is not necessary, this commit fixes most of them.

Change-Id: I84c72ea4d6680f8bdbef5449316dd9a8af8c8286
Closes-Bug: 1550892
2016-02-29 17:23:29 +00:00
Brandon Palm
f49f0fead2 Fixed a bunch of spacing
Nothing too complicated here.  I fixed a bunch of spacing issues
that I saw in OSC.

Change-Id: I935ab48e7c5bac5f88ecdb3a05f73fb44fc9f41d
2016-02-23 10:38:58 -06:00
guang-yee
41e1bd0be6 Support unscoped token request
Make scope check optional for the "token issue" command as unscoped token is
a valid Keystone V2/V3 API.

Change-Id: Ie1cded4dbfdafd3a78c0ebdf89e3f66762509930
Closes-Bug: #1543214
2016-02-19 16:07:13 -08:00
Jenkins
272ac55776 Merge "Return names in list role assignments" 2016-02-17 22:23:51 +00:00
lin-hua-cheng
686a269738 Add "token revoke" for identity v3
Change-Id: Ie631600d02942fe6ce035f31af46abe44e543631
Closes-bug: #1543226
2016-02-09 16:49:11 -08:00
Akihiro Motoki
258c1102cc log take_action parameters in a single place
Previously each command logs take_action parameters explicitly
by using @utils.log_method decorator or log.debug().
Some commands have no logging.

This commit calls a logger in the base class and
drops all logging definition from individual commands.

Closes-Bug: #1532294
Change-Id: I43cd0290a4353c68c075bade9571c940733da1be
2016-02-02 09:58:32 +09:00
Tom Cocozzello
3a48989eb0 Return names in list role assignments
Utilize the new include names functionality added to
list role assignments (GET /role_assignments?include_names=True).
Which will return the names of the entities instead of their
IDs.

Change-Id: I6dc03baf61ef9354a8a259a9f17ff47ce1665ce7
Depends-On: I4aa77c08660a0cbd021502155938a46121ca76ef
Closes-Bug: #1479569
Implements: blueprint list-assignment-with-names
2016-01-27 18:13:32 +00:00
Guang Yee
5cbecc130e Support non-interactive user password update
Currently user password update require interactive prompting of user's
original password. This is problematic because we can't support
non-interactive applications and therefore hinders automation. This
patch make it possible by optionally accepting an
'--original-password' argument. If specified, we would use it instead
of prompting.

DocImpact

Change-Id: I2d994e8c2be949f7ae616ac1d1594fb94e1a27cd
Closes-Bug: 1531360
2016-01-11 09:27:10 -08:00
Jenkins
774201b696 Merge "Implementation for project unset cmd for python-openstackclient." 2016-01-04 19:09:31 +00:00
Jude Job
a2a63f19bf Implementation for project unset cmd for python-openstackclient.
This patch introduces a unit test class TestProjectUnset
for testing unset cmd.

Co-Authored-By: Steve Martinelli <stevemar@ca.ibm.com>
Change-Id: Ib4a414d2313e3d37e48d1cb3639f064231aec508
Closes-Bug: #1486597
2016-01-04 10:25:55 -05:00
Jude Job
66931c6931 Enabling domain lookup for project set v3 command
Currently the domain option for `project set` attempts to set
a new domain that owns the project. This is actually an action
that is denied by keystone server. Instead, the domain option
should be used as a lookup, to find projects that exist in the
non-default domain.

Co-Authored-By: Steve Martinelli <stevemar@ca.ibm.com>

Closes-Bug: #1524456

Change-Id: I30a3812184fe262667e09baa106d2275c2cbb981
2015-12-31 02:11:39 -05:00