summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi NATSUME <natsume.takashi@lab.ntt.co.jp>2018-07-09 18:40:41 +0900
committerTakashi NATSUME <natsume.takashi@lab.ntt.co.jp>2018-07-09 22:02:13 +0900
commit2e6ef0c45a6ada10440eb0ce87df74bf7070c1e4 (patch)
treedad67b1e42561df42cf61037e893deba7b9d7d75
parent4cca340520064978ac9fb73d742d7412bbc7af09 (diff)
downloadpython-novaclient-2e6ef0c45a6ada10440eb0ce87df74bf7070c1e4.tar.gz
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
-rw-r--r--doc/source/cli/nova.rst6
-rw-r--r--novaclient/shell.py25
-rw-r--r--novaclient/tests/functional/v2/legacy/test_readonly_nova.py2
-rw-r--r--releasenotes/notes/bug-1778536-a1b5d65a0d4ad622.yaml12
4 files changed, 35 insertions, 10 deletions
diff --git a/doc/source/cli/nova.rst b/doc/source/cli/nova.rst
index cd6d60ee..14f63c4c 100644
--- a/doc/source/cli/nova.rst
+++ b/doc/source/cli/nova.rst
@@ -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
diff --git a/novaclient/shell.py b/novaclient/shell.py
index 83471243..8eb4311c 100644
--- a/novaclient/shell.py
+++ b/novaclient/shell.py
@@ -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)
diff --git a/novaclient/tests/functional/v2/legacy/test_readonly_nova.py b/novaclient/tests/functional/v2/legacy/test_readonly_nova.py
index df88b8c6..6b9598e9 100644
--- a/novaclient/tests/functional/v2/legacy/test_readonly_nova.py
+++ b/novaclient/tests/functional/v2/legacy/test_readonly_nova.py
@@ -124,4 +124,4 @@ class SimpleReadOnlyNovaClientTest(base.ClientTestBase):
self.assertRaises(exceptions.CommandFailed,
self.nova,
'list',
- flags='--endpoint-override badurl')
+ flags='--os-endpoint-override badurl')
diff --git a/releasenotes/notes/bug-1778536-a1b5d65a0d4ad622.yaml b/releasenotes/notes/bug-1778536-a1b5d65a0d4ad622.yaml
new file mode 100644
index 00000000..3e5410aa
--- /dev/null
+++ b/releasenotes/notes/bug-1778536-a1b5d65a0d4ad622.yaml
@@ -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