Fix backend_name and section name mismatch

Change-Id: I16a56250dfea62630bcc096fcda194b81316da48
This commit is contained in:
Gustavo Sanchez 2022-01-25 13:32:59 -04:00
parent ad443c2d8e
commit c6b3544ae3
No known key found for this signature in database
GPG Key ID: CB6FDA23F1075685
2 changed files with 1 additions and 8 deletions

View File

@ -77,7 +77,7 @@ class CinderStoragePluginCharm(ops_openstack.core.OSBaseCharm):
def set_data(self, data, config, app_name): def set_data(self, data, config, app_name):
"""Inform another charm of the backend name and configuration.""" """Inform another charm of the backend name and configuration."""
data['backend_name'] = config['volume-backend-name'] or app_name data['backend_name'] = app_name
data['stateless'] = str(self.stateless) data['stateless'] = str(self.stateless)
data['active_active'] = str(self.active_active) data['active_active'] = str(self.active_active)
data['subordinate_configuration'] = self.render_config( data['subordinate_configuration'] = self.render_config(

View File

@ -127,19 +127,12 @@ class TestBaseCinderCharm(unittest.TestCase):
juju-info: juju-info:
interface: juju-info interface: juju-info
scope: container scope: container
''',
config='''
options:
volume-backend-name:
default: ""
type: string
''' '''
) )
self.addCleanup(self.harness.cleanup) self.addCleanup(self.harness.cleanup)
self.harness.begin() self.harness.begin()
self.harness.set_leader(True) self.harness.set_leader(True)
backend = self.harness.add_relation('storage-backend', 'cinder') backend = self.harness.add_relation('storage-backend', 'cinder')
self.harness.update_config({'volume-backend-name': 'test'})
self.harness.add_relation_unit(backend, 'cinder/0') self.harness.add_relation_unit(backend, 'cinder/0')
def test_cinder_base(self): def test_cinder_base(self):