diff options
author | Stephen Finucane <stephenfin@redhat.com> | 2022-04-05 17:48:01 +0100 |
---|---|---|
committer | Stephen Finucane <stephenfin@redhat.com> | 2022-04-06 14:17:59 +0100 |
commit | 0fb7190c062a08a3969a71955c014e3a572cdc9e (patch) | |
tree | 3001530e3c0741f2bec3d563cf64c1dd4511e8d5 /novaclient/shell.py | |
parent | cd08a847179d144fea03a7ffd8f92b06c387b966 (diff) | |
download | python-novaclient-0fb7190c062a08a3969a71955c014e3a572cdc9e.tar.gz |
Deprecate nova CLI
It is time to signal that we're fully committed to delivering a pure
OSC experience.
Based on the neutron change from 6 (!!) years ago [1]
[1] https://github.com/openstack/python-neutronclient/commit/3a64a7a166be25d40436fd40c8351a79267bd3c4
Change-Id: Ib80548e104a751179f36f2a6ebff9916d38fdf1e
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Diffstat (limited to 'novaclient/shell.py')
-rw-r--r-- | novaclient/shell.py | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/novaclient/shell.py b/novaclient/shell.py index 7762be9b..468e889b 100644 --- a/novaclient/shell.py +++ b/novaclient/shell.py @@ -20,6 +20,7 @@ Command-line interface to the OpenStack Nova API. import argparse import logging +import os import sys from keystoneauth1 import loading @@ -816,9 +817,19 @@ class OpenStackHelpFormatter(argparse.HelpFormatter): super(OpenStackHelpFormatter, self).start_section(heading) -def main(): +def main(argv=sys.argv[1:]): try: - argv = [encodeutils.safe_decode(a) for a in sys.argv[1:]] + # Special dansmith envvar to hide the warning. Don't rely on this + # because we will eventually remove all this stuff. + if os.environ.get("NOVACLIENT_ISHOULDNTBEDOINGTHIS") != "1": + print( + _( + "nova CLI is deprecated and will be a removed in a future " + "release" + ), + file=sys.stderr, + ) + argv = [encodeutils.safe_decode(a) for a in argv] OpenStackComputeShell().main(argv) except Exception as exc: logger.debug(exc, exc_info=1) |