Commit Graph

5 Commits

Author SHA1 Message Date
Stephen Finucane aed521d426 Blacken openstackclient.identity
Black used with the '-l 79 -S' flags.

A future change will ignore this commit in git-blame history by adding a
'git-blame-ignore-revs' file.

Change-Id: I2eeade1ce6653be8e9179ecc40105182c5ff5f16
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2023-05-10 10:51:30 +01:00
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
Vishakha Agarwal 81fd5c995d Updated the take_actions for unified limits
When user passes --region None, the find_resource
of osc_lib calls get() of region. The get API of
region ignores the name param returning all the
regions in result. As the find_resource checks
many cases against the result returned by get API.
The output comes greater than 1, thus returning
"More than one region ID exist" which is incorrect.
However in case of region which cannot be filtered
by name we do not require to check these many cases.

The solution is to directly call the get method of
APIs and returning No resource name exist with the
xyz" on passing invaid parameter. And returning all
in case of None.

Thus created a new function get_resource which can
be used in future too by these types of API's.

Change-Id: Ib3f881d34a82af97199ce51bfbefc6f3f08599f1
Closes-bug: #1799153
2018-11-09 07:53:55 +05:30
Vishakha Agarwal 0d764cdb5a Add project param in LimitList parser
when doing openstack limit list --project xyz_id,
CLI raising error unrecognized arguments, whereas
in api-ref document [1], user can pass project_id
as query param.This addresses the above issue, by
adding param --project in parser of LimitList.

[1] https://developer.openstack.org/api-ref/identity/v3/index.html

Change-Id: If4644cc99a3803f61f4a688b828aeb73977fc0dd
Closes-Bug: #1798744
2018-11-08 11:19:24 -06:00
Lance Bragstad 735896eb1a Implement support for project limits
This commit let's users manage limits via the command line.

bp unified-limits

Change-Id: I7c44bbb60557378b66c5c43a7ba917f40dc2b633
2018-07-23 21:52:00 +00:00