Rename --endpoint-override to --os-endpoint-override

The ``--endpoint-override`` command line argument has been deprecated.
It is renamed to ``--os-endpoint-override`` to avoid misinterpreting
command line arguments.
It defaults to the ``OS_ENDPOINT_OVERRIDE`` environment variable.

The deprecated ``--bypass-url`` command line argument has been removed.

Change-Id: Ic8a6559cd62d46b837fa9c04b482a46ceba829db
Closes-Bug: #1778536
changes/91/580991/3
Takashi NATSUME 4 years ago
parent 4cca340520
commit 2e6ef0c45a
  1. 6
      doc/source/cli/nova.rst
  2. 25
      novaclient/shell.py
  3. 2
      novaclient/tests/functional/v2/legacy/test_readonly_nova.py
  4. 12
      releasenotes/notes/bug-1778536-a1b5d65a0d4ad622.yaml

@ -33,7 +33,7 @@ nova usage
[--service-name <service-name>]
[--os-endpoint-type <endpoint-type>]
[--os-compute-api-version <compute-api-ver>]
[--endpoint-override <bypass-url>] [--profile HMAC_KEY]
[--os-endpoint-override <bypass-url>] [--profile HMAC_KEY]
[--insecure] [--os-cacert <ca-certificate>]
[--os-cert <certificate>] [--os-key <key>] [--timeout <seconds>]
[--os-auth-type <name>] [--os-auth-url OS_AUTH_URL]
@ -678,10 +678,10 @@ nova optional arguments
minor part) or "X.latest", defaults to
``env[OS_COMPUTE_API_VERSION]``.
``--endpoint-override <bypass-url>``
``--os-endpoint-override <bypass-url>``
Use this API endpoint instead of the Service
Catalog. Defaults to
``env[NOVACLIENT_ENDPOINT_OVERRIDE]``.
``env[OS_ENDPOINT_OVERRIDE]``.
``--profile HMAC_KEY``
HMAC key to use for encrypting context data

@ -358,19 +358,32 @@ class OpenStackComputeShell(object):
'"X.latest", defaults to env[OS_COMPUTE_API_VERSION].'))
parser.add_argument(
'--endpoint-override',
'--os-endpoint-override',
metavar='<bypass-url>',
dest='endpoint_override',
default=utils.env('NOVACLIENT_ENDPOINT_OVERRIDE',
default=utils.env('OS_ENDPOINT_OVERRIDE',
'NOVACLIENT_ENDPOINT_OVERRIDE',
'NOVACLIENT_BYPASS_URL'),
help=_("Use this API endpoint instead of the Service Catalog. "
"Defaults to env[NOVACLIENT_ENDPOINT_OVERRIDE]."))
"Defaults to env[OS_ENDPOINT_OVERRIDE]."))
# NOTE(takashin): This dummy '--end' argument was added
# to avoid misinterpreting command line arguments.
# If there is not this dummy argument, the '--end' is interpreted to
# the '--endpoint-override'.
# TODO(takashin): Remove this dummy '--end' argument
# when the deprecated '--endpoint-override' argument is removed.
parser.add_argument(
'--end',
metavar='<end>',
nargs='?',
help=argparse.SUPPRESS)
parser.add_argument(
'--bypass-url',
'--endpoint-override',
action=DeprecatedAction,
use=_('use "%s"; this option will be removed after Pike OpenStack '
'release.') % '--os-endpoint-override',
use=_('use "%s"; this option will be removed after Rocky '
'OpenStack release.') % '--os-endpoint-override',
dest='endpoint_override',
help=argparse.SUPPRESS)

@ -124,4 +124,4 @@ class SimpleReadOnlyNovaClientTest(base.ClientTestBase):
self.assertRaises(exceptions.CommandFailed,
self.nova,
'list',
flags='--endpoint-override badurl')
flags='--os-endpoint-override badurl')

@ -0,0 +1,12 @@
---
upgrade:
- The deprecated ``--bypass-url`` command line argument has been removed.
deprecations:
- |
The ``--endpoint-override`` command line argument has been deprecated.
It is renamed to ``--os-endpoint-override`` to avoid misinterpreting
command line arguments.
It defaults to the ``OS_ENDPOINT_OVERRIDE`` environment variable.
See `bug 1778536`_ for more details.
.. _bug 1778536: https://bugs.launchpad.net/python-novaclient/+bug/1778536
Loading…
Cancel
Save