From 1807485976a2091efb257ad67efbd3b96d4dbe3b Mon Sep 17 00:00:00 2001
From: Tom Barron <tpb@dyncloud.net>
Date: Wed, 6 Apr 2016 14:34:40 -0400
Subject: [PATCH] Deprecate manila-all command

/usr/local/bin/manila-all purports to start all the manila
services within a single process.  We should deprecate this
command since to do this in production would be a very bad
idea - completely un-"cloudy" - and we don't even do it in
devstack.

Implements blueprint deprecate-manila-all

Change-Id: I0ac0c699071324b218f63422354a871b7fa3b81e
---
 manila/cmd/all.py            | 6 ++++++
 manila/tests/cmd/test_all.py | 3 +++
 2 files changed, 9 insertions(+)

diff --git a/manila/cmd/all.py b/manila/cmd/all.py
index 1893874b64..fcc759b7cf 100755
--- a/manila/cmd/all.py
+++ b/manila/cmd/all.py
@@ -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
diff --git a/manila/tests/cmd/test_all.py b/manila/tests/cmd/test_all.py
index e8cebd22a3..3196f6ad07 100644
--- a/manila/tests/cmd/test_all.py
+++ b/manila/tests/cmd/test_all.py
@@ -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')