Use getattr properly in legacy shell
Fixes bug 1131703 Change-Id: If97f422af170c29785d2bf8884fafff979031e14
This commit is contained in:
@@ -266,8 +266,9 @@ def _get_images(gc, args):
|
||||
|
||||
optional_kwargs = ['marker', 'sort_key', 'sort_dir']
|
||||
for kwarg in optional_kwargs:
|
||||
if getattr(args, kwarg):
|
||||
parameters[kwarg] = getattr(args.kwarg)
|
||||
value = getattr(args, kwarg, None)
|
||||
if value is not None:
|
||||
parameters[kwarg] = value
|
||||
|
||||
return gc.images.list(**parameters)
|
||||
|
||||
|
Reference in New Issue
Block a user