diff --git a/src/lib/charm/openstack/cinder_purestorage.py b/src/lib/charm/openstack/cinder_purestorage.py index 2e540d8..78e6998 100644 --- a/src/lib/charm/openstack/cinder_purestorage.py +++ b/src/lib/charm/openstack/cinder_purestorage.py @@ -37,7 +37,8 @@ class CinderpurestorageCharm( ('pure_automatic_max_oversubscription_ratio', self.config.get('automatic-max-oversubscription')), ('volume_driver', volumedriver), - ('volume_backend_name', service)] + ('volume_backend_name', service), + ('allowed_direct_url_schemes', 'cinder')] if self.config.get('protocol') == 'iscsi': if self.config.get('iscsi-cidr'): diff --git a/src/tests/tests_cinder_purestorage.py b/src/tests/tests_cinder_purestorage.py index 38ab086..1595819 100644 --- a/src/tests/tests_cinder_purestorage.py +++ b/src/tests/tests_cinder_purestorage.py @@ -50,3 +50,15 @@ class CinderpurestorageTest(test_utils.OpenStackBaseTest): getattr(test_vol, 'os-vol-host-attr:host').split('#')[0], 'cinder@cinder-purestorage') self.cinder_client.volumes.delete(vol_new) + + # Check to see if allowed_direct_url_schemes gets propagated to + # /etc/cinder/cinder.conf + def test_config_propagation(self): + expected_contents = { + 'cinder-purestorage': { + 'allowed_direct_url_schemes': ['cinder']}} + zaza.model.block_until_oslo_config_entries_match( + 'cinder', + '/etc/cinder/cinder.conf', + expected_contents, + model_name=self.model_name) diff --git a/unit_tests/test_lib_charm_openstack_cinder_purestorage.py b/unit_tests/test_lib_charm_openstack_cinder_purestorage.py index af1c6f1..033f1a8 100644 --- a/unit_tests/test_lib_charm_openstack_cinder_purestorage.py +++ b/unit_tests/test_lib_charm_openstack_cinder_purestorage.py @@ -51,4 +51,5 @@ class TestCinderpurestorageCharm(test_utils.PatchHelper): ('pure_automatic_max_oversubscription_ratio', None), ('volume_driver', None), - ('volume_backend_name', None)]) + ('volume_backend_name', None), + ('allowed_direct_url_schemes', 'cinder')])