From 1c02c0da1702ab1f58e930782a8866ed683c3c7d Mon Sep 17 00:00:00 2001 From: Robert Breker Date: Fri, 14 Apr 2023 23:24:02 +0100 Subject: [PATCH] Fix nova-manage image_property show unexpected keyword Reproduction steps: 1. Execute: nova-manage image_property show \ hw_vif_multiqueue_enabled 2. Observe: An error has occurred: Traceback (most recent call last): File "/var/lib/kolla/venv/lib/python3.9/ site-packages/nova/cmd/manage.py", line 3394, in main ret = fn(*fn_args, **fn_kwargs) TypeError: show() got an unexpected keyword argument 'property' Change-Id: I1349b880934ad9f44a943cf7de324d7338619d2e Closes-Bug: #2016346 --- nova/cmd/manage.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nova/cmd/manage.py b/nova/cmd/manage.py index 45ae678ab4c1..5d4926b3ec11 100644 --- a/nova/cmd/manage.py +++ b/nova/cmd/manage.py @@ -3195,7 +3195,7 @@ class ImagePropertyCommands: 'instance_uuid', metavar='', help='UUID of the instance') @args( - 'property', metavar='', + 'image_property', metavar='', help='Image property to show') def show(self, instance_uuid=None, image_property=None): """Show value of a given instance image property. @@ -3213,10 +3213,10 @@ class ImagePropertyCommands: with context.target_cell(ctxt, im.cell_mapping) as cctxt: instance = objects.Instance.get_by_uuid( cctxt, instance_uuid, expected_attrs=['system_metadata']) - image_property = instance.system_metadata.get( + property_value = instance.system_metadata.get( f'image_{image_property}') - if image_property: - print(image_property) + if property_value: + print(property_value) return 0 else: print(f'Image property {image_property} not found '