Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 2165620

Summary: imageutils: calling str on a QemuImgInfo instance raises AttributeError
Product: Red Hat OpenStack Reporter: Hervé Beraud <hberaud>
Component: python-oslo-utilsAssignee: Hervé Beraud <hberaud>
Status: CLOSED EOL QA Contact: nlevinki <nlevinki>
Severity: medium Docs Contact:
Priority: high    
Version: 17.0 (Wallaby)CC: apevec, lhh, nlevinki
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-oslo-utils-4.8.2-0.20230201110447.a38b56a.el9osttrunk Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 2165616 Environment:
Last Closed: 2023-10-10 12:23:24 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2165616    
Bug Blocks:    

Description Hervé Beraud 2023-01-30 15:09:08 UTC
+++ This bug was initially created as a clone of Bug #2165616 +++

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

Comment 1 Hervé Beraud 2023-02-01 12:33:30 UTC
Fixed in version python-oslo-utils-4.8.2-0.20230201110447.a38b56a.el9osttrunk

https://brewweb.engineering.redhat.com/brew/buildinfo?buildID=2355226

Comment 2 Priscila Gutierres 2023-10-10 12:23:24 UTC
Support has ended on 22 September 2023.