summaryrefslogtreecommitdiff
path: root/openstackclient
diff options
context:
space:
mode:
authorJamie Lennox <jamielennox@redhat.com>2015-05-05 12:43:12 +1000
committerJamie Lennox <jamielennox@redhat.com>2015-05-05 12:45:42 +1000
commit179ed18c30cea438e13ba92997d3f671e5f76a84 (patch)
treecbd736d86ce8d2688105936f8ac9e900e51eb6a0 /openstackclient
parentb50ff9d3c59f27ee165e569a697d63ca154291b4 (diff)
downloadpython-openstackclient-179ed18c30cea438e13ba92997d3f671e5f76a84.tar.gz
Don't create empty quota set requests
The way that getattr is called with the None default you will always create a compute_kwargs dictionary with key: None values. This means that we will always send these empty requests to the servers. Change so that only actually changed values end up in the quota set requests and get sent. Change-Id: I33bc3f4e1a8013ec672e995648d27513064baf26 Closes-Bug: #1451640
Diffstat (limited to 'openstackclient')
-rw-r--r--openstackclient/common/quota.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/openstackclient/common/quota.py b/openstackclient/common/quota.py
index ea1dc38f..a40f6e4d 100644
--- a/openstackclient/common/quota.py
+++ b/openstackclient/common/quota.py
@@ -97,8 +97,9 @@ class SetQuota(command.Command):
compute_kwargs = {}
for k, v in COMPUTE_QUOTAS.items():
- if v in parsed_args:
- compute_kwargs[k] = getattr(parsed_args, v, None)
+ value = getattr(parsed_args, v, None)
+ if value is not None:
+ compute_kwargs[k] = value
volume_kwargs = {}
for k, v in VOLUME_QUOTAS.items():