Skip to content

Commit

Permalink
[imageutils] Fix __str__ for QemuImgInfo
Browse files Browse the repository at this point in the history
Code is calling 'appened' on a list; correct this to 'append'.

Closes-bug: #1996426
Change-Id: I8729cf180f92f43519c942e22f3b285377a5612f
  • Loading branch information
ostackbrian committed Nov 11, 2022
1 parent cb8076b commit d49d594
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion oslo_utils/imageutils.py
Expand Up @@ -100,7 +100,7 @@ def __str__(self):
if self.encrypted:
lines.append("encrypted: %s" % self.encrypted)
if self.format_specific:
lines.appened("format_specific: %s" % self.format_specific)
lines.append("format_specific: %s" % self.format_specific)
return "\n".join(lines)

def _canonicalize(self, field):
Expand Down
3 changes: 3 additions & 0 deletions oslo_utils/tests/test_imageutils.py
Expand Up @@ -264,6 +264,9 @@ def test_qemu_img_info(self, mock_deprecate):
self.assertEqual(13168640, image_info.disk_size)
self.assertEqual("bar", image_info.format_specific["data"]["foo"])
self.assertEqual('yes', image_info.encrypted)
# test for Bug #1996426
expected_str = "format_specific: {'data': {'foo': 'bar'}}"
self.assertIn(expected_str, str(image_info))

@mock.patch("debtcollector.deprecate")
def test_qemu_img_info_blank(self, mock_deprecate):
Expand Down

0 comments on commit d49d594

Please sign in to comment.