diff options
| author | Stephen Finucane <sfinucan@redhat.com> | 2022-09-23 18:00:34 +0100 |
|---|---|---|
| committer | Stephen Finucane <sfinucan@redhat.com> | 2022-09-30 12:40:15 +0100 |
| commit | 04e68e0d5a49be93f79d6d71821ab8cd0b0ce589 (patch) | |
| tree | a9b60de6ced03d9a2cd4aca06e20428155b16a49 /openstackclient/tests/functional/common | |
| parent | 47e667e71d997ad4a7b0dd86bf462f746c964b54 (diff) | |
| download | python-openstackclient-04e68e0d5a49be93f79d6d71821ab8cd0b0ce589.tar.gz | |
quota: Add 'quota show --usage' option
Provide an more sane way to get usage information for a particular
project's quotas. This requires using the 'Lister' command type since
the 'ShowOne' command type only allows for simple key-value pair output.
We also add a note indicating that the '<project>' argument is optional.
Change-Id: Ic7342cf08f024cc690049414c5eef5b9a7594677
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Diffstat (limited to 'openstackclient/tests/functional/common')
| -rw-r--r-- | openstackclient/tests/functional/common/test_quota.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/openstackclient/tests/functional/common/test_quota.py b/openstackclient/tests/functional/common/test_quota.py index 783294df..08ec626f 100644 --- a/openstackclient/tests/functional/common/test_quota.py +++ b/openstackclient/tests/functional/common/test_quota.py @@ -114,6 +114,7 @@ class QuotaTests(base.TestCase): cmd_output = json.loads(self.openstack( 'quota show -f json ' + self.PROJECT_NAME )) + cmd_output = {x['Resource']: x['Limit'] for x in cmd_output} self.assertIsNotNone(cmd_output) self.assertEqual( 31, @@ -136,6 +137,7 @@ class QuotaTests(base.TestCase): self.assertIsNotNone(cmd_output) # We don't necessarily know the default quotas, we're checking the # returned attributes + cmd_output = {x['Resource']: x['Limit'] for x in cmd_output} self.assertTrue(cmd_output["cores"] >= 0) self.assertTrue(cmd_output["backups"] >= 0) if self.haz_network: @@ -150,6 +152,7 @@ class QuotaTests(base.TestCase): 'quota show -f json --class default' )) self.assertIsNotNone(cmd_output) + cmd_output = {x['Resource']: x['Limit'] for x in cmd_output} self.assertEqual( 33, cmd_output["key-pairs"], @@ -166,6 +169,7 @@ class QuotaTests(base.TestCase): self.assertIsNotNone(cmd_output) # We don't necessarily know the default quotas, we're checking the # returned attributes + cmd_output = {x['Resource']: x['Limit'] for x in cmd_output} self.assertTrue(cmd_output["key-pairs"] >= 0) self.assertTrue(cmd_output["snapshots"] >= 0) |
