summaryrefslogtreecommitdiff
path: root/openstackclient/common
diff options
context:
space:
mode:
authorRui Chen <chenrui.momo@gmail.com>2016-08-05 12:07:13 +0800
committerRui Chen <chenrui.momo@gmail.com>2016-09-12 11:00:55 +0800
commit6fba7163e85a436d1fe0660d9932a53d06b1a343 (patch)
tree26cf39aa2dbbec1db5635e58875a5f95ed02bcaa /openstackclient/common
parent4e71e9da6b729212516eceb0aa556ecbc4dfdf36 (diff)
downloadpython-openstackclient-6fba7163e85a436d1fe0660d9932a53d06b1a343.tar.gz
Set quota "per_volume_gigabytes", "backup_gigabytes" and "backups"
"per_volume_gigabytes", "backup_gigabytes" and "backups" items can be shown in "openstack quota show" command, but can't be updated by "openstack quota set". This patch fix the issue. Change-Id: I47db5a69d4e4ef6e140f2735257c83e1fb052760 Closes-Bug: #1609767
Diffstat (limited to 'openstackclient/common')
-rw-r--r--openstackclient/common/quota.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/openstackclient/common/quota.py b/openstackclient/common/quota.py
index 5d53171c..8ae6f7d4 100644
--- a/openstackclient/common/quota.py
+++ b/openstackclient/common/quota.py
@@ -43,11 +43,20 @@ COMPUTE_QUOTAS = {
}
VOLUME_QUOTAS = {
+ 'backups': 'backups',
+ 'backup_gigabytes': 'backup-gigabytes',
'gigabytes': 'gigabytes',
+ 'per_volume_gigabytes': 'per-volume-gigabytes',
'snapshots': 'snapshots',
'volumes': 'volumes',
}
+IMPACT_VOLUME_TYPE_QUOTAS = [
+ 'gigabytes',
+ 'snapshots',
+ 'volumes',
+]
+
NOVA_NETWORK_QUOTAS = {
'floating_ips': 'floating-ips',
'security_group_rules': 'secgroup-rules',
@@ -128,7 +137,8 @@ class SetQuota(command.Command):
for k, v in VOLUME_QUOTAS.items():
value = getattr(parsed_args, k, None)
if value is not None:
- if parsed_args.volume_type:
+ if (parsed_args.volume_type and
+ k in IMPACT_VOLUME_TYPE_QUOTAS):
k = k + '_%s' % parsed_args.volume_type
volume_kwargs[k] = value