Skip to content

Commit 179ed18

Browse files
author
Jamie Lennox
committed
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
1 parent b50ff9d commit 179ed18

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎openstackclient/common/quota.py‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,9 @@ def take_action(self, parsed_args):
9797

9898
compute_kwargs = {}
9999
for k, v in COMPUTE_QUOTAS.items():
100-
if v in parsed_args:
101-
compute_kwargs[k] = getattr(parsed_args, v, None)
100+
value = getattr(parsed_args, v, None)
101+
if value is not None:
102+
compute_kwargs[k] = value
102103

103104
volume_kwargs = {}
104105
for k, v in VOLUME_QUOTAS.items():

0 commit comments

Comments
 (0)