summaryrefslogtreecommitdiff
path: root/openstackclient/common
diff options
context:
space:
mode:
authorRodolfo Alonso Hernandez <ralonsoh@redhat.com>2021-07-27 16:45:24 +0000
committerRodolfo Alonso Hernandez <ralonsoh@redhat.com>2021-12-07 17:49:26 +0000
commitbef70397a3e1240cc593b3fb34049f2ff6601e68 (patch)
tree25ad4af54a4448fd931fc1d125ca0977d55be430 /openstackclient/common
parent59256becc93d7953f983e0fbbdef098fefba73ff (diff)
downloadpython-openstackclient-bef70397a3e1240cc593b3fb34049f2ff6601e68.tar.gz
Add network update quota "limit_check" parameter
This new parameter commands the Neutron server to first check the resource usage before setting the new quota limit. If the resource usage is below the new limit, the Neutron server will raise an exception. Depends-On: https://review.opendev.org/c/openstack/openstacksdk/+/806254 Depends-On: https://review.opendev.org/c/openstack/neutron/+/801470 Partial-Bug: #1936408 Change-Id: Idc1b99492d609eb699d0a6bef6cd760458a774f6
Diffstat (limited to 'openstackclient/common')
-rw-r--r--openstackclient/common/quota.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/openstackclient/common/quota.py b/openstackclient/common/quota.py
index 643cb4e4..677cba03 100644
--- a/openstackclient/common/quota.py
+++ b/openstackclient/common/quota.py
@@ -535,6 +535,12 @@ class SetQuota(common.NetDetectionMixin, command.Command):
action='store_true',
help=_('Force quota update (only supported by compute)')
)
+ parser.add_argument(
+ '--check-limit',
+ action='store_true',
+ help=_('Check quota limit when updating (only supported by '
+ 'network)')
+ )
return parser
def take_action(self, parsed_args):
@@ -561,6 +567,9 @@ class SetQuota(common.NetDetectionMixin, command.Command):
volume_kwargs[k] = value
network_kwargs = {}
+ if parsed_args.check_limit:
+ network_kwargs['check_limit'] = True
+
if self.app.client_manager.is_network_endpoint_enabled():
for k, v in NETWORK_QUOTAS.items():
value = getattr(parsed_args, k, None)