Fix multi-backend configuration

At the moment, the enabled backends' names list is written in the config file
as a space-separated list.

When using multi-backend, the current Manila charm crashes because the config
`enabled_share_backends` needs to a comma-separated list of backend names instead:
https://docs.openstack.org/manila/victoria/admin/shared-file-systems-multi-backend.html

Change-Id: I881d12ad4cea044e232b9f997a4dfc4b2f38e9c8
This commit is contained in:
Ionut Balutoiu 2021-03-01 11:58:30 +02:00 committed by Aurelien Lourot
parent 405519c9f4
commit 37819cd9f3
2 changed files with 3 additions and 3 deletions

View File

@ -68,12 +68,12 @@ def computed_share_backends(config):
"""Determine the backend protocols that are provided as a string.
This asks the charm class what the backend protocols are, and then provides
it as a space separated list of backends.
it as a comma separated list of backends.
:param config: the config option on which to look up config options
:returns: string
"""
return ' '.join(config.charm_instance.configured_backends)
return ','.join(config.charm_instance.configured_backends)
@charms_openstack.adapters.config_property

View File

@ -50,7 +50,7 @@ class TestManilaCharmConfigProperties(Helper):
def test_computed_share_backends(self):
config = mock.MagicMock()
config.charm_instance.configured_backends = ["a", "c", "b"]
self.assertEqual(manila.computed_share_backends(config), "a c b")
self.assertEqual(manila.computed_share_backends(config), "a,c,b")
def test_computed_share_protocols(self):
config = mock.MagicMock()