Merge "Add LVM as default backend"

This commit is contained in:
Zuul 2017-10-17 10:25:49 +00:00 committed by Gerrit Code Review
commit 6c731ad9fe
2 changed files with 9 additions and 7 deletions

View File

@ -137,12 +137,12 @@ class StorageBackendContext(OSContextGenerator):
backends.append('CEPH')
if enable_lvm():
backends.append('LVM')
if len(backends) > 0:
return {
'active_backends': backends,
'backends': ",".join(backends)}
else:
return {}
# Use the package default backend to stop the service flapping.
if not backends:
backends = ['LVM']
return {
'active_backends': backends,
'backends': ",".join(backends)}
class LoggingConfigContext(OSContextGenerator):

View File

@ -113,7 +113,9 @@ class TestCinderContext(CharmTestCase):
self.config.return_value = None
self.relation_ids.return_value = []
self.os_release.return_value = 'havana'
self.assertEqual(contexts.StorageBackendContext()(), {})
self.assertEqual(
contexts.StorageBackendContext()(),
{'active_backends': ['LVM'], 'backends': 'LVM'})
def test_storage_backend_single_backend(self):
rel_dict = {