Use getattr properly in legacy shell

Fixes bug 1131703

Change-Id: If97f422af170c29785d2bf8884fafff979031e14
This commit is contained in:
Brian Waldon
2013-02-22 10:15:50 -08:00
parent 6c7fb0e46c
commit fbb858aa77

View File

@@ -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)