Fix TypeError when doing cluster-scale-in

When trying to scale-in a cluster without configuring
'count' option, TypeError will happen. This is because
'count' is not the key of 'params'.

Closes-Bug: #1485820
Change-Id: I753bf2f9234910271254e6a60110b98a3d9994c7
This commit is contained in:
Haiwei Xu
2015-08-18 10:21:26 +09:00
parent 1706db22ce
commit 6fdbce89e4

View File

@@ -102,7 +102,8 @@ class Client(object):
def action(self, cls, options):
def filter_args(method, params):
expected_args = inspect.getargspec(method).args
accepted_args = ([a for a in expected_args if a != 'self'])
accepted_args = ([a for a in expected_args and params
if a != 'self'])
filtered_args = dict((d, params[d]) for d in accepted_args)
return filtered_args