Browse Source

Fix backend_name and section name mismatch

Change-Id: I16a56250dfea62630bcc096fcda194b81316da48
changes/42/826342/3
Gustavo Sanchez 5 months ago
parent
commit
c6b3544ae3
No known key found for this signature in database
GPG Key ID: CB6FDA23F1075685
  1. 2
      ops_openstack/plugins/classes.py
  2. 7
      unit_tests/test_plugins_classes.py

2
ops_openstack/plugins/classes.py

@ -77,7 +77,7 @@ class CinderStoragePluginCharm(ops_openstack.core.OSBaseCharm):
def set_data(self, data, config, app_name):
"""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['active_active'] = str(self.active_active)
data['subordinate_configuration'] = self.render_config(

7
unit_tests/test_plugins_classes.py

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

Loading…
Cancel
Save