diff options
author | Andrey Pavlov <apavlov@mirantis.com> | 2015-11-05 12:59:41 +0300 |
---|---|---|
committer | Andrey Pavlov <apavlov@mirantis.com> | 2015-11-09 13:19:23 +0300 |
commit | 902284f6b2ddbb71189326c6f8437d6a20a61f61 (patch) | |
tree | 03239dfe3a5faf8d8f726aded43a7ac330bc0e0e /saharaclient | |
parent | 1919f56c9f8dc26b84dec08eeb76214fddbc07a9 (diff) | |
download | python-saharaclient-902284f6b2ddbb71189326c6f8437d6a20a61f61.tar.gz |
Deprecation of the Sahara CLI
The Sahara CLI is superceded by the
OpenStackClient plugin and now can be deprecated.
Partially implements: blueprint cli-as-openstackclient-plugin
Change-Id: If87dd728f0ca638410f8547658f687da4accf4f6
Diffstat (limited to 'saharaclient')
-rw-r--r-- | saharaclient/shell.py | 7 | ||||
-rw-r--r-- | saharaclient/tests/functional/test_readonly_sahara.py | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/saharaclient/shell.py b/saharaclient/shell.py index 67bcd5b..682b808 100644 --- a/saharaclient/shell.py +++ b/saharaclient/shell.py @@ -27,6 +27,7 @@ import argparse import getpass import logging import sys +import warnings import six @@ -710,6 +711,12 @@ class OpenStackHelpFormatter(argparse.HelpFormatter): def main(): + warnings.simplefilter('once', category=DeprecationWarning) + warnings.warn('The sahara CLI is deprecated in favor of OpenStackClient ' + 'plugin and will not be maintained anymore. ' + 'For a Python library, continue using python-saharaclient.', + DeprecationWarning) + warnings.resetwarnings() try: argv = [encodeutils.safe_decode(a) for a in sys.argv[1:]] OpenStackSaharaShell().main(argv) diff --git a/saharaclient/tests/functional/test_readonly_sahara.py b/saharaclient/tests/functional/test_readonly_sahara.py index d8f7e43..05c3868 100644 --- a/saharaclient/tests/functional/test_readonly_sahara.py +++ b/saharaclient/tests/functional/test_readonly_sahara.py @@ -135,7 +135,7 @@ class SimpleReadOnlySaharaClientTest(base.ClientTestBase): def test_sahara_help(self): help_text = self.sahara('help') lines = help_text.split('\n') - self.assertFirstLineStartsWith(lines, 'usage: sahara') + self.assertIn('DeprecationWarning', lines[0]) commands = [] cmds_start = lines.index('Positional arguments:') |