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']
|
optional_kwargs = ['marker', 'sort_key', 'sort_dir']
|
||||||
for kwarg in optional_kwargs:
|
for kwarg in optional_kwargs:
|
||||||
if getattr(args, kwarg):
|
value = getattr(args, kwarg, None)
|
||||||
parameters[kwarg] = getattr(args.kwarg)
|
if value is not None:
|
||||||
|
parameters[kwarg] = value
|
||||||
|
|
||||||
return gc.images.list(**parameters)
|
return gc.images.list(**parameters)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user