Description of problem: When a QemuImgInfo object contains a format_specific value, calling str() on it raises "AttributeError: 'list' object has no attribute 'appened'" Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: Python 3.9.14 (main, Oct 4 2022, 17:06:42) >>> from oslo_utils import imageutils >>> fake_data = imageutils.QemuImgInfo() >>> fake_data.type = 'vmdk' >>> fake_data.format_specific = {'type': 'vmdk', 'data': {}} >>> fake_data.format_specific['data']['create-type'] = 'monolithicSparse' >>> str(fake_data) Traceback (most recent call last): File "<stdin>", line 1, in <module> File ".tox/py39/lib/python3.9/site-packages/oslo_utils/imageutils.py", line 103, in __str__ lines.appened("format_specific: %s" % self.format_specific) AttributeError: 'list' object has no attribute 'appened' >>> Actual results: Traceback (most recent call last): File "<stdin>", line 1, in <module> File ".tox/py39/lib/python3.9/site-packages/oslo_utils/imageutils.py", line 103, in __str__ lines.appened("format_specific: %s" % self.format_specific) AttributeError: 'list' object has no attribute 'appened' Expected results: No attributeError Additional info: A fix exist upstream and should be cherry-picked to OSP17.x https://opendev.org/openstack/oslo.utils/commit/d49d5944824f15d00e04e1b9c7f8c3b03b440c95
Fixed in version python-oslo-utils-4.8.2-1.20230201104135.a38b56a.el8osttrunk https://brewweb.engineering.redhat.com/brew/buildinfo?buildID=2355193
Verified: Python 3.9.16 (main, Dec 8 2022, 00:00:00) [GCC 11.3.1 20221121 (Red Hat 11.3.1-4)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from oslo_utils import imageutils >>> fake_data = imageutils.QemuImgInfo() >>> fake_data.type = 'vmdk' >>> fake_data.format_specific = {'type': 'vmdk', 'data': {}} >>> fake_data.format_specific['data']['create-type'] = 'monolithicSparse' >>> str(fake_data) "image: None\nfile_format: None\nvirtual_size: None\ndisk_size: None\ncluster_size: None\nbacking_file: None\nformat_specific: {'type': 'vmdk', 'data': {'create-type': 'monolithicSparse'}}" >>>
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (Release of components for Red Hat OpenStack Platform 17.1 (Wallaby)), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHEA-2023:4577