From b328cf74df7f94a20de85b3c0992dcb65e818458 Mon Sep 17 00:00:00 2001 From: hackertron Date: Thu, 19 Mar 2020 14:35:54 +0100 Subject: Add '--force; parameter to 'openstack quota set' The compute service allows us to to force set a quota, setting a quota value that is less than the amount of the resource currently consumed. Expose this feature by way of a '--force' boolean parameter. Change-Id: I1d1ac1ac46f49f64794ffc8631e166935537966c --- openstackclient/common/quota.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'openstackclient/common') diff --git a/openstackclient/common/quota.py b/openstackclient/common/quota.py index 37437344..7a0dda14 100644 --- a/openstackclient/common/quota.py +++ b/openstackclient/common/quota.py @@ -516,6 +516,11 @@ class SetQuota(common.NetDetectionMixin, command.Command): metavar='', help=_('Set quotas for a specific '), ) + parser.add_argument( + '--force', + action='store_true', + help=_('Force quota update (only supported by compute)') + ) return parser def take_action(self, parsed_args): @@ -529,6 +534,9 @@ class SetQuota(common.NetDetectionMixin, command.Command): if value is not None: compute_kwargs[k] = value + if parsed_args.force: + compute_kwargs['force'] = True + volume_kwargs = {} for k, v in VOLUME_QUOTAS.items(): value = getattr(parsed_args, k, None) -- cgit v1.2.1