diff options
| author | hackertron <jayadityagupta11@gmail.com> | 2020-03-19 14:35:54 +0100 |
|---|---|---|
| committer | jay <jayadityagupta11@gmail.com> | 2020-04-14 22:59:52 +0200 |
| commit | b328cf74df7f94a20de85b3c0992dcb65e818458 (patch) | |
| tree | f1ec12b333ae6ec57574da70e864dae87feadfa9 /openstackclient/common | |
| parent | 8c4ecbe35dbf95ab91e693caff85132d9b881044 (diff) | |
| download | python-openstackclient-b328cf74df7f94a20de85b3c0992dcb65e818458.tar.gz | |
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
Diffstat (limited to 'openstackclient/common')
| -rw-r--r-- | openstackclient/common/quota.py | 8 |
1 files changed, 8 insertions, 0 deletions
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='<volume-type>', help=_('Set quotas for a specific <volume-type>'), ) + 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) |
