Make cinder-all binary deprecated

This command is not tested. Add warning that 'cinder-all' is
deprecated as now cinder services run apart.

Implements: blueprint cinder-all-is-deprecated
Change-Id: Ia86a42d297d81fc8272f580e25a3219b90073a77
This commit is contained in:
Yuriy Nesenenko 2016-04-07 19:50:25 +03:00 committed by yuriy_n
parent 6a07e105fb
commit 2513cefebc
2 changed files with 7 additions and 2 deletions

View File

@ -32,6 +32,7 @@ import sys
from oslo_config import cfg
from oslo_log import log as logging
from oslo_log import versionutils
from oslo_reports import guru_meditation_report as gmr
from oslo_reports import opts as gmr_opts
@ -42,7 +43,7 @@ i18n.enable_lazy()
from cinder.cmd import volume as volume_cmd
from cinder.common import config # noqa
from cinder.db import api as session
from cinder.i18n import _LE
from cinder.i18n import _LE, _
from cinder import objects
from cinder import rpc
from cinder import service
@ -62,6 +63,8 @@ def main():
config.set_middleware_defaults()
logging.setup(CONF, "cinder")
LOG = logging.getLogger('cinder.all')
versionutils.report_deprecated_feature(LOG, _(
'cinder-all is deprecated in Newton and will be removed in Ocata.'))
utils.monkey_patch()

View File

@ -122,6 +122,7 @@ class TestCinderAllCmd(test.TestCase):
def tearDown(self):
super(TestCinderAllCmd, self).tearDown()
@mock.patch('oslo_log.versionutils.report_deprecated_feature')
@mock.patch('cinder.rpc.init')
@mock.patch('cinder.service.Service.create')
@mock.patch('cinder.service.WSGIService')
@ -130,7 +131,7 @@ class TestCinderAllCmd(test.TestCase):
@mock.patch('oslo_log.log.getLogger')
@mock.patch('oslo_log.log.setup')
def test_main(self, log_setup, get_logger, monkey_patch, process_launcher,
wsgi_service, service_create, rpc_init):
wsgi_service, service_create, rpc_init, mock_log_utils):
CONF.set_override('enabled_backends', None)
launcher = process_launcher.return_value
server = wsgi_service.return_value
@ -139,6 +140,7 @@ class TestCinderAllCmd(test.TestCase):
cinder_all.main()
self.assertTrue(mock_log_utils.called)
self.assertEqual('cinder', CONF.project)
self.assertEqual(CONF.version, version.version_string())
log_setup.assert_called_once_with(CONF, "cinder")