diff options
| author | Alex Katz <akatz@akatz.tlv.csb> | 2020-01-05 14:08:04 +0200 |
|---|---|---|
| committer | Alex Katz <akatz@redhat.com> | 2020-01-08 18:47:51 +0200 |
| commit | 780d9b49a0f9a1bef5007e3e75275a1d48a96b13 (patch) | |
| tree | eeade26be12be07437d586fac1cd0b6717b12847 | |
| parent | 5b3a827a1ff80e4b51c7ede44b84bf640d5b6380 (diff) | |
| download | python-openstackclient-780d9b49a0f9a1bef5007e3e75275a1d48a96b13.tar.gz | |
Show correct name for resource with quota set to zero
In case quota for the resource is set to zero "openstack quota show"
command will not map the resource name according to one of the
following dicts:
- COMPUTE_QUOTAS
- NOVA_NETWORK_QUOTAS
- VOLUME_QUOTAS
- NETWORK_QUOTAS
For example:
$ openstack quota set --secgroups 10 admin
$ openstack quota show admin -f json|egrep "(secgroups|security_groups)"
"secgroups": 10,
$ openstack quota set --secgroups 0 admin
$ openstack quota show admin -f json|egrep "(secgroups|security_groups)"
"security_groups": 0,
Change-Id: I94ed9e6b41b1cc692297c01e6c7582998dcacfda
| -rw-r--r-- | openstackclient/common/quota.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/openstackclient/common/quota.py b/openstackclient/common/quota.py index 80c8749a..ef21e696 100644 --- a/openstackclient/common/quota.py +++ b/openstackclient/common/quota.py @@ -650,7 +650,7 @@ class ShowQuota(command.ShowOne, BaseQuota): for k, v in itertools.chain( COMPUTE_QUOTAS.items(), NOVA_NETWORK_QUOTAS.items(), VOLUME_QUOTAS.items(), NETWORK_QUOTAS.items()): - if not k == v and info.get(k): + if not k == v and info.get(k) is not None: info[v] = info[k] info.pop(k) |
