diff --git a/doc/source/command-objects/quota.rst b/doc/source/command-objects/quota.rst index dc5e362355..381601db77 100644 --- a/doc/source/command-objects/quota.rst +++ b/doc/source/command-objects/quota.rst @@ -25,6 +25,8 @@ Set quotas for project [--key-pairs ] [--properties ] [--ram ] + [--server-groups ] + [--server-group-members ] # Block Storage settings [--gigabytes ] @@ -64,6 +66,8 @@ Set quotas for class [--key-pairs ] [--properties ] [--ram ] + [--server-groups ] + [--server-group-members ] # Block Storage settings [--gigabytes ] @@ -108,6 +112,14 @@ Set quotas for class New value for the injected-file-size quota +.. option:: --server-groups + + New value for the server-groups quota + +.. option:: --server-group-members + + New value for the server-group-members quota + .. option:: --floating-ips New value for the floating-ips quota diff --git a/openstackclient/common/quota.py b/openstackclient/common/quota.py index 3c12c3665d..5d53171c33 100644 --- a/openstackclient/common/quota.py +++ b/openstackclient/common/quota.py @@ -38,6 +38,8 @@ COMPUTE_QUOTAS = { 'key_pairs': 'key-pairs', 'metadata_items': 'properties', 'ram': 'ram', + 'server_groups': 'server-groups', + 'server_group_members': 'server-group-members', } VOLUME_QUOTAS = { diff --git a/openstackclient/tests/common/test_quota.py b/openstackclient/tests/common/test_quota.py index 6f001c8548..16fa35f625 100644 --- a/openstackclient/tests/common/test_quota.py +++ b/openstackclient/tests/common/test_quota.py @@ -115,6 +115,8 @@ class TestQuotaSet(TestQuota): '--properties', str(compute_fakes.property_num), '--secgroup-rules', str(compute_fakes.secgroup_rule_num), '--secgroups', str(compute_fakes.secgroup_num), + '--server-groups', str(compute_fakes.servgroup_num), + '--server-group-members', str(compute_fakes.servgroup_members_num), identity_fakes.project_name, ] verifylist = [ @@ -131,6 +133,8 @@ class TestQuotaSet(TestQuota): ('metadata_items', compute_fakes.property_num), ('security_group_rules', compute_fakes.secgroup_rule_num), ('security_groups', compute_fakes.secgroup_num), + ('server_groups', compute_fakes.servgroup_num), + ('server_group_members', compute_fakes.servgroup_members_num), ('project', identity_fakes.project_name), ] @@ -153,6 +157,8 @@ class TestQuotaSet(TestQuota): 'metadata_items': compute_fakes.property_num, 'security_group_rules': compute_fakes.secgroup_rule_num, 'security_groups': compute_fakes.secgroup_num, + 'server_groups': compute_fakes.servgroup_num, + 'server_group_members': compute_fakes.servgroup_members_num, } self.quotas_mock.update.assert_called_with( diff --git a/openstackclient/tests/compute/v2/fakes.py b/openstackclient/tests/compute/v2/fakes.py index b4243a22bb..85c11c9479 100644 --- a/openstackclient/tests/compute/v2/fakes.py +++ b/openstackclient/tests/compute/v2/fakes.py @@ -36,6 +36,8 @@ instance_num = 10 property_num = 128 secgroup_rule_num = 20 secgroup_num = 10 +servgroup_num = 10 +servgroup_members_num = 10 project_name = 'project_test' QUOTA = { 'project': project_name, @@ -51,6 +53,8 @@ QUOTA = { 'properties': property_num, 'secgroup_rules': secgroup_rule_num, 'secgroups': secgroup_num, + 'server-groups': servgroup_num, + 'server-group-members': servgroup_members_num } QUOTA_columns = tuple(sorted(QUOTA)) diff --git a/releasenotes/notes/add-server-group-quotas-b67fcba98619f0c9.yaml b/releasenotes/notes/add-server-group-quotas-b67fcba98619f0c9.yaml new file mode 100644 index 0000000000..9b62b3e6ea --- /dev/null +++ b/releasenotes/notes/add-server-group-quotas-b67fcba98619f0c9.yaml @@ -0,0 +1,6 @@ +--- +features: + - Added support of --server-groups --server-group-members options + to ``quota set`` command. + + [Bug `1602223 `_]