16 Commits

Author SHA1 Message Date
lihaijing
d15bbada73 Replace six.iteritems() with .items()
1. As mentioned in [1], we should avoid using six.iteritems to achieve
   iterators. We can use dict.items instead, as it will return iterators
   in PY3 as well. And dict.items/keys will more readable.

2. In py2, the performance about list should be negligible,
   see the link [2].

[1] https://wiki.openstack.org/wiki/Python3
[2] http://lists.openstack.org/pipermail/openstack-dev/2015-June/066391.html

Co-Authored-By: Akihiro Motoki <amotoki@gmail.com>
Change-Id: I4b9edb326444264c0f6c4ad281acaac356a07e85
Implements: blueprint replace-iteritems-with-items
2020-01-09 18:41:29 +09:00
Kristi Nikolla
da53c2b334 When creating a trust, send role_ids instead or role_names
This changes create a trust to use ids instead of names because of
the possibility of roles sharing a name. Even if the user
uniquely identified a role by inputting the id, the request sent
to the identity service would used the name, therefore the command
would fail in the case that two roles share a name.

This does not change how trusts are displayed during trust list or
trust show, a name will still be shown instead of an id.

Depends-On: I38e0ac35946ee6e53128babac3ea759a380572e0

Change-Id: I5bdf89f1e288954a7f5c2704231f270bc7d196f5
Closes-Bug: 1696111
2017-06-22 17:08:01 +00:00
Hongbin Lu
5cf77bb672 Handle 403 error on creating trust
Currently, creating trust requires permission to list roles, but
non-admin users don't have permission to do that by default. This
commit adds exception handling on listing roles, and continue to
create trust if server returns 403.

Closes-Bug: #1658582
Change-Id: I4f016b76cb46ae07ef65ed54780881bbcd6210d3
2017-01-24 01:50:36 +00:00
Huanxuan Ao
96578cb8ab Error handling for delete commands in identity
Add missing multi deletion error handling for
identity delete commands.
All delete commands in identity support
error handling now.

Change-Id: I05626dcb5e516a423d610906347b02236ba7eeaf
2017-01-03 23:30:49 +08:00
Steve Martinelli
0ef8535036 translate all command help strings
Leverage the new cliff command class attribute (_description)
to get the help of a command, this allows us to mark strings
for translation. We could not do this before since the help
was grabbed from the docstring.

This also depends on a new release of cliff and a bump to the
minimum level in osc's requirements.

Closes-Bug: 1636209
Depends-On: Id915f6aa7d95a0ff3dc6e2ceaac5decb3f3bf0da
Change-Id: I8673080bb5625e8e3c499feaefd42dfc7121e96f
2016-11-17 02:33:42 +00: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
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
Tang Chen
5293bb103e Fix i18n support problems in identity
Change-Id: I3b48d17850343051239b5b69e8b890dba32d3ac8
Partial-bug: #1574965
2016-06-07 09:37:02 +08: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
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
Jenkins
4d9d2dbd36 Merge "Make trustee/trustor/project searchable by ID" 2015-07-21 19:46:16 +00:00
Steve Martinelli
921361b3ae Make trustee/trustor/project searchable by ID
In the previous implementation, we were always including the domain
argument, which caused a lookup by name for trustee/trustor and
project. By excluding it when not necessary, we do a search by
ID in find_resources.

Change-Id: Id756aeab522b5dccb2dc6b31d137a28514b0fdf6
Closes-Bug: 1473298
2015-07-20 20:12:50 -07:00
Gilles Dubreuil
00b4e38d3c Removes trailing blank in trust show
Previously a blank character at the end of the roles value would remain

Change-Id: I0961a5f9fb4b270a6055ee69898eadee315e416a
Closes-Bug: 1474707
2015-07-19 13:33:00 -07:00
Steve Martinelli
2b0013c5c1 Refactor option handling for user|group|project domain scoping
put the common options in identity.common, this way the help is
consistent

Change-Id: I5b09cfb56fa0f8d16feb95150f216fccbe9f2b22
2015-06-17 12:38:40 -04:00
Steve Martinelli
00eeb3593c remove unnecessary conditionals
In several places we had else branches where a reasonable default
would do the job. This makes the code a mean cleaer and easier to
read.

Change-Id: I231e09aab85fd32b8300bc33c48d0899b728b96e
2015-04-19 02:41:04 -04:00
Steve Martinelli
cf23fd5cf6 Implement trust in identity v3 api
Added new module in identity v3 api to handle create, read, and delete
operations of trust resources.

Co-Authored-By: Lance Bragstad <lbragstad@gmail.com>
Co-Authored-By: Steve Martinelli <stevemar@ca.ibm.com>

Closes-Bug: #1413718
Change-Id: I2b360b141ff70d4f396466abede859a3db6644f4
2015-02-08 20:49:43 -05:00