Merge "Fix nova-manage image_property show unexpected keyword"
This commit is contained in:
commit
fcda90460f
|
@ -3276,7 +3276,7 @@ class ImagePropertyCommands:
|
||||||
'instance_uuid', metavar='<instance_uuid>',
|
'instance_uuid', metavar='<instance_uuid>',
|
||||||
help='UUID of the instance')
|
help='UUID of the instance')
|
||||||
@args(
|
@args(
|
||||||
'property', metavar='<image_property>',
|
'image_property', metavar='<image_property>',
|
||||||
help='Image property to show')
|
help='Image property to show')
|
||||||
def show(self, instance_uuid=None, image_property=None):
|
def show(self, instance_uuid=None, image_property=None):
|
||||||
"""Show value of a given instance image property.
|
"""Show value of a given instance image property.
|
||||||
|
@ -3294,10 +3294,10 @@ class ImagePropertyCommands:
|
||||||
with context.target_cell(ctxt, im.cell_mapping) as cctxt:
|
with context.target_cell(ctxt, im.cell_mapping) as cctxt:
|
||||||
instance = objects.Instance.get_by_uuid(
|
instance = objects.Instance.get_by_uuid(
|
||||||
cctxt, instance_uuid, expected_attrs=['system_metadata'])
|
cctxt, instance_uuid, expected_attrs=['system_metadata'])
|
||||||
image_property = instance.system_metadata.get(
|
property_value = instance.system_metadata.get(
|
||||||
f'image_{image_property}')
|
f'image_{image_property}')
|
||||||
if image_property:
|
if property_value:
|
||||||
print(image_property)
|
print(property_value)
|
||||||
return 0
|
return 0
|
||||||
else:
|
else:
|
||||||
print(f'Image property {image_property} not found '
|
print(f'Image property {image_property} not found '
|
||||||
|
|
Loading…
Reference in New Issue