diff --git a/hooks/cinder_contexts.py b/hooks/cinder_contexts.py index 055621e8..61c7f1f2 100644 --- a/hooks/cinder_contexts.py +++ b/hooks/cinder_contexts.py @@ -41,8 +41,7 @@ class CephContext(OSContextGenerator): # ensure_ceph_pool() creates pool based on service name. 'rbd_pool': service, 'rbd_user': service, - 'host': service, - 'use_syslog': config('use-syslog') + 'host': service } @@ -76,3 +75,11 @@ class ApacheSSLContext(SSLContext): if not service_enabled('cinder-api'): return {} return super(ApacheSSLContext, self).__call__() + + +class CinderContext(OSContextGenerator): + def __call__(self): + ctxt = { + 'use_syslog': config('use-syslog') + } + return ctxt diff --git a/hooks/cinder_utils.py b/hooks/cinder_utils.py index e9bdf15a..54fa329c 100644 --- a/hooks/cinder_utils.py +++ b/hooks/cinder_utils.py @@ -103,7 +103,8 @@ CONFIG_FILES = OrderedDict([ context.OSConfigFlagContext(), cinder_contexts.CephContext(), cinder_contexts.HAProxyContext(), - cinder_contexts.ImageServiceContext()], + cinder_contexts.ImageServiceContext(), + cinder_contexts.CinderContext()], 'services': ['cinder-api', 'cinder-volume', 'cinder-scheduler', 'haproxy'] }), diff --git a/unit_tests/test_cinder_contexts.py b/unit_tests/test_cinder_contexts.py index 524564c8..b5a6ca7d 100644 --- a/unit_tests/test_cinder_contexts.py +++ b/unit_tests/test_cinder_contexts.py @@ -43,14 +43,12 @@ class TestCinderContext(CharmTestCase): self.relation_ids.return_value = ['ceph:0'] service = 'mycinder' self.service_name.return_value = service - self.config.return_value = False self.assertEquals( contexts.CephContext()(), {'volume_driver': 'cinder.volume.driver.RBDDriver', 'rbd_pool': service, 'rbd_user': service, - 'host': service, - 'use_syslog': False}) + 'host': service}) def test_haproxy_configuration(self): self.determine_haproxy_port.return_value = 8080