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
This commit is contained in:
Frank Berghaus 2024-06-06 15:18:53 +02:00
parent a6e8a3866e
commit d22f56bba1
3 changed files with 12 additions and 3 deletions

View File

@ -204,7 +204,7 @@ class ManilaShare(resource.Resource):
return return
if name == self.EXPORT_LOCATIONS_ATTR: if name == self.EXPORT_LOCATIONS_ATTR:
attr = self._request_export_locations() attr = self._request_export_locations()
else: return attr
attr = getattr(self._request_share(), name) attr = getattr(self._request_share(), name)
return str(attr) return str(attr)

View File

@ -225,7 +225,7 @@ class ManilaShareTest(common.HeatTestCase):
DummyShareExportLocation()] DummyShareExportLocation()]
self.assertEqual('az', share.FnGetAtt('availability_zone')) self.assertEqual('az', share.FnGetAtt('availability_zone'))
self.assertEqual('host', share.FnGetAtt('host')) 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('id', share.FnGetAtt('share_server_id'))
self.assertEqual('ca', share.FnGetAtt('created_at')) self.assertEqual('ca', share.FnGetAtt('created_at'))
self.assertEqual('s', share.FnGetAtt('status')) self.assertEqual('s', share.FnGetAtt('status'))

View File

@ -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