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
This commit is contained in:
Takashi NATSUME 2018-07-09 18:40:41 +09:00
parent 4cca340520
commit 2e6ef0c45a
4 changed files with 35 additions and 10 deletions

View File

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

View File

@ -358,19 +358,32 @@ class OpenStackComputeShell(object):
'"X.latest", defaults to env[OS_COMPUTE_API_VERSION].')) '"X.latest", defaults to env[OS_COMPUTE_API_VERSION].'))
parser.add_argument( parser.add_argument(
'--endpoint-override', '--os-endpoint-override',
metavar='<bypass-url>', metavar='<bypass-url>',
dest='endpoint_override', dest='endpoint_override',
default=utils.env('NOVACLIENT_ENDPOINT_OVERRIDE', default=utils.env('OS_ENDPOINT_OVERRIDE',
'NOVACLIENT_ENDPOINT_OVERRIDE',
'NOVACLIENT_BYPASS_URL'), 'NOVACLIENT_BYPASS_URL'),
help=_("Use this API endpoint instead of the Service Catalog. " 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( parser.add_argument(
'--bypass-url', '--endpoint-override',
action=DeprecatedAction, action=DeprecatedAction,
use=_('use "%s"; this option will be removed after Pike OpenStack ' use=_('use "%s"; this option will be removed after Rocky '
'release.') % '--os-endpoint-override', 'OpenStack release.') % '--os-endpoint-override',
dest='endpoint_override', dest='endpoint_override',
help=argparse.SUPPRESS) help=argparse.SUPPRESS)

View File

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

View File

@ -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