Remove support for single backend config

It was not recommended for some releases, deprecated in Newton, so let's
remove it in Ocata.

Change-Id: If7e76ad904179a89ca98eb81ebe40e0243245672
Related-Bug: 1630975
This commit is contained in:
Michał Dulko 2016-11-09 09:26:31 +01:00
parent 6767593558
commit e8e3ae7616
3 changed files with 11 additions and 25 deletions

View File

@ -46,7 +46,7 @@ i18n.enable_lazy()
# Need to register global_opts
from cinder.common import config # noqa
from cinder.db import api as session
from cinder.i18n import _, _LW
from cinder.i18n import _, _LE
from cinder import service
from cinder import utils
from cinder import version
@ -109,15 +109,9 @@ def main():
launcher.launch_service(server)
service_started = True
else:
LOG.warning(_LW('Configuration for cinder-volume does not specify '
'"enabled_backends", using DEFAULT as backend. '
'Support for DEFAULT section to configure drivers '
'will be removed in the next release.'))
server = service.Service.create(binary='cinder-volume',
coordination=True,
cluster=CONF.cluster)
launcher.launch_service(server)
service_started = True
LOG.error(_LE('Configuration for cinder-volume does not specify '
'"enabled_backends". Using DEFAULT section to configure '
'drivers is not supported since Ocata.'))
if not service_started:
msg = _('No volume service(s) started successfully, terminating.')

View File

@ -156,21 +156,8 @@ class TestCinderVolumeCmd(test.TestCase):
def test_main(self, log_setup, monkey_patch, service_create,
get_launcher):
CONF.set_override('enabled_backends', None)
launcher = get_launcher.return_value
server = service_create.return_value
cinder_volume.main()
self.assertEqual('cinder', CONF.project)
self.assertEqual(CONF.version, version.version_string())
log_setup.assert_called_once_with(CONF, "cinder")
monkey_patch.assert_called_once_with()
get_launcher.assert_called_once_with()
service_create.assert_called_once_with(binary='cinder-volume',
coordination=True,
cluster=None)
launcher.launch_service.assert_called_once_with(server)
launcher.wait.assert_called_once_with()
self.assertRaises(SystemExit, cinder_volume.main)
self.assertFalse(service_create.called)
@mock.patch('cinder.service.get_launcher')
@mock.patch('cinder.service.Service.create')

View File

@ -0,0 +1,5 @@
---
upgrade:
- Configurations that are setting backend config in ``[DEFAULT]``
section are now not supported. You should use ``enabled_backends``
option to set up backends.