bug in adding cinder context

This commit is contained in:
yolanda.robla@canonical.com
2014-02-03 12:03:26 +01:00
parent 728b0df292
commit e5dab8b1ce
3 changed files with 12 additions and 6 deletions

View File

@@ -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

View File

@@ -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']
}),

View File

@@ -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