diff options
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) |