From d22f56bba1b22209ffb428cded8cfb1c8c30d426 Mon Sep 17 00:00:00 2001 From: Frank Berghaus Date: Thu, 6 Jun 2024 15:18:53 +0200 Subject: [PATCH] Return export_locations as a list export_locations is expected to be a list of strings. Previously it was returned as a string representation of a list, which makes it impossible to select the location with get_attr. Story: 2011146 Task: 50283 Closes-Bug: 2068490 Change-Id: I530ee92cb3f1fac27bbdad7387275c8a265a125d --- heat/engine/resources/openstack/manila/share.py | 4 ++-- heat/tests/openstack/manila/test_share.py | 2 +- releasenotes/notes/story-2011146-07db485192f8c2f3.yaml | 9 +++++++++ 3 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 releasenotes/notes/story-2011146-07db485192f8c2f3.yaml diff --git a/heat/engine/resources/openstack/manila/share.py b/heat/engine/resources/openstack/manila/share.py index 61e93163cc..9fc2345b0f 100644 --- a/heat/engine/resources/openstack/manila/share.py +++ b/heat/engine/resources/openstack/manila/share.py @@ -204,8 +204,8 @@ class ManilaShare(resource.Resource): return if name == self.EXPORT_LOCATIONS_ATTR: attr = self._request_export_locations() - else: - attr = getattr(self._request_share(), name) + return attr + attr = getattr(self._request_share(), name) return str(attr) def handle_create(self): diff --git a/heat/tests/openstack/manila/test_share.py b/heat/tests/openstack/manila/test_share.py index cf4e787ed4..7a096de3d6 100644 --- a/heat/tests/openstack/manila/test_share.py +++ b/heat/tests/openstack/manila/test_share.py @@ -225,7 +225,7 @@ class ManilaShareTest(common.HeatTestCase): DummyShareExportLocation()] self.assertEqual('az', share.FnGetAtt('availability_zone')) self.assertEqual('host', share.FnGetAtt('host')) - self.assertEqual("['el']", share.FnGetAtt('export_locations')) + self.assertEqual(['el'], share.FnGetAtt('export_locations')) self.assertEqual('id', share.FnGetAtt('share_server_id')) self.assertEqual('ca', share.FnGetAtt('created_at')) self.assertEqual('s', share.FnGetAtt('status')) diff --git a/releasenotes/notes/story-2011146-07db485192f8c2f3.yaml b/releasenotes/notes/story-2011146-07db485192f8c2f3.yaml new file mode 100644 index 0000000000..41138fda41 --- /dev/null +++ b/releasenotes/notes/story-2011146-07db485192f8c2f3.yaml @@ -0,0 +1,9 @@ +--- +upgrade: + - | + ``OS::Manila::Share`` attribute ``export_locations`` will now be a list of + export paths +fixes: + - | + ``OS::Manila::Share`` attribute ``export_locations`` will now be a list of + export paths