Merge "Deprecate manila-all command"

This commit is contained in:
Jenkins 2016-04-08 13:27:55 +00:00 committed by Gerrit Code Review
commit 2cb172d6d2
2 changed files with 9 additions and 0 deletions

View File

@ -33,11 +33,13 @@ import sys
from oslo_config import cfg
from oslo_log import log
from oslo_log import versionutils
from manila import i18n
i18n.enable_lazy()
from manila.common import config # Need to register global_opts
from manila.i18n import _
from manila.i18n import _LE
from manila import service
from manila import utils
@ -54,6 +56,10 @@ def main():
log.setup(CONF, "manila")
LOG = log.getLogger('manila.all')
msg = _('manila-all is deprecated in Newton and '
'will be removed in Ocata.')
versionutils.report_deprecated_feature(LOG, msg)
utils.monkey_patch()
launcher = service.process_launcher()
# manila-api

View File

@ -18,6 +18,7 @@ import sys
import ddt
import mock
from oslo_log import log
from oslo_log import versionutils
from manila.cmd import all as manila_all
from manila import service
@ -41,6 +42,7 @@ class ManilaCmdAllTestCase(test.TestCase):
self.mock_object(service, 'process_launcher')
self.mock_object(service, 'WSGIService')
self.mock_object(service.Service, 'create')
self.mock_object(versionutils, 'report_deprecated_feature')
self.wsgi_service = service.WSGIService.return_value
self.service = service.Service.create.return_value
self.fake_log = log.getLogger.return_value
@ -51,6 +53,7 @@ class ManilaCmdAllTestCase(test.TestCase):
log.setup.assert_called_once_with(CONF, "manila")
log.register_options.assert_called_once_with(CONF)
log.getLogger.assert_called_once_with('manila.all')
self.assertEqual(versionutils.report_deprecated_feature.call_count, 1)
utils.monkey_patch.assert_called_once_with()
service.process_launcher.assert_called_once_with()
service.WSGIService.assert_called_once_with('osapi_share')