From b4f93e335e305faf04af1b4828195a9f550628af Mon Sep 17 00:00:00 2001 From: Artem Goncharov Date: Thu, 9 Sep 2021 17:29:56 +0200 Subject: [PATCH] Change image.hw_qemu_guest_agent to be string hw_qemu_guest_agent attribute of the image is a string boolean supporting `yes` and `no` and not a real boolean like we were expecting. Replace it to be string instead. Change-Id: I5b9714e4388df440bf881033283da4e8aa1db497 --- openstack/image/v2/image.py | 5 +++-- openstack/tests/unit/image/v2/test_image.py | 2 +- .../fix-image-hw_qemu_guest_agent-bf1147e52c84b5e8.yaml | 5 +++++ 3 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 releasenotes/notes/fix-image-hw_qemu_guest_agent-bf1147e52c84b5e8.yaml diff --git a/openstack/image/v2/image.py b/openstack/image/v2/image.py index bbf700a31..9509b95c9 100644 --- a/openstack/image/v2/image.py +++ b/openstack/image/v2/image.py @@ -224,8 +224,9 @@ class Image(resource.Resource, resource.TagMixin, _download.DownloadMixin): os_type = resource.Body('os_type') #: The operating system admin username. os_admin_user = resource.Body('os_admin_user') - #: If true, QEMU guest agent will be exposed to the instance. - hw_qemu_guest_agent = resource.Body('hw_qemu_guest_agent', type=bool) + #: A string boolean, which if "true", QEMU guest agent will be exposed + #: to the instance. + hw_qemu_guest_agent = resource.Body('hw_qemu_guest_agent', type=str) #: If true, require quiesce on snapshot via QEMU guest agent. os_require_quiesce = resource.Body('os_require_quiesce', type=bool) #: The URL for the schema describing a virtual machine image. diff --git a/openstack/tests/unit/image/v2/test_image.py b/openstack/tests/unit/image/v2/test_image.py index 9ddd95305..0676bd326 100644 --- a/openstack/tests/unit/image/v2/test_image.py +++ b/openstack/tests/unit/image/v2/test_image.py @@ -84,7 +84,7 @@ EXAMPLE = { 'auto_disk_config': True, 'os_type': '49', 'os_admin_user': 'ubuntu', - 'hw_qemu_guest_agent': True, + 'hw_qemu_guest_agent': 'yes', 'os_require_quiesce': True, } diff --git a/releasenotes/notes/fix-image-hw_qemu_guest_agent-bf1147e52c84b5e8.yaml b/releasenotes/notes/fix-image-hw_qemu_guest_agent-bf1147e52c84b5e8.yaml new file mode 100644 index 000000000..3d67a068a --- /dev/null +++ b/releasenotes/notes/fix-image-hw_qemu_guest_agent-bf1147e52c84b5e8.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - | + hw_qemu_guest_agent attribute of the image is a string boolean with values + `yes` and `no`.