Only enable the default backend for ocata+

When deploying on icehouse with Ceph, the RBD backend is
configured globally, but cinder sets enabled_backends to "LVM",
which exists (and is wrong to boot).

This commit moves the check for empty "backends" under the ocata
check.  Per comment #5 on LP:1719742: "The cinder-volume service
fails to start in ocata+ if enable-backends is not set."

Closes-Bug: #1753611

Change-Id: I07a9f9c739064bc93870a1f8f68a7624b7ce3033
Signed-off-by: Craige McWhirter <craige@mcwhirter.io>
This commit is contained in:
Craige McWhirter 2018-03-15 11:37:49 +10:00 committed by Frode Nordahl
parent e373d9ea13
commit 8369ea875c
2 changed files with 4 additions and 4 deletions

View File

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

View File

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