Add LVM as default backend

This change set the enable-backends cinder config option to the
package default of 'lvm'. The reason is to stop the service flapping
and fix the bug which is causing cinder-volume service to be down
in some deployments.

Change-Id: I29b9bccf75019b73f60c1160b8b6c7cb11d3ad28
Closes-Bug: 1719742
This commit is contained in:
Liam Young 2017-10-16 07:56:52 +00:00
parent d234309b92
commit f9654dce7d
3 changed files with 10 additions and 7 deletions

1
.gitignore vendored
View File

@ -5,3 +5,4 @@ bin
*.sw[nop]
*.pyc
.unit-state.db
.stestr

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 = {