From c6b3544ae3a39818a4b8f201fd4b1c7b5d3e084a Mon Sep 17 00:00:00 2001 From: Gustavo Sanchez Date: Tue, 25 Jan 2022 13:32:59 -0400 Subject: [PATCH] Fix backend_name and section name mismatch Change-Id: I16a56250dfea62630bcc096fcda194b81316da48 --- ops_openstack/plugins/classes.py | 2 +- unit_tests/test_plugins_classes.py | 7 ------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/ops_openstack/plugins/classes.py b/ops_openstack/plugins/classes.py index f5bf7a1..5496e5f 100644 --- a/ops_openstack/plugins/classes.py +++ b/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( diff --git a/unit_tests/test_plugins_classes.py b/unit_tests/test_plugins_classes.py index 2541899..4680ba4 100644 --- a/unit_tests/test_plugins_classes.py +++ b/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):