summaryrefslogtreecommitdiff
path: root/novaclient/client.py
diff options
context:
space:
mode:
authorAndrey Kurilin <akurilin@mirantis.com>2016-12-02 20:26:32 +0200
committerAndrey Kurilin <andr.kurilin@gmail.com>2016-12-15 19:49:03 +0200
commit9df9aff6fc921e7d4b5439f6bde76384f1d31d2f (patch)
tree86bd82b55f9a8c235300eb2ebfbcba1d5660b385 /novaclient/client.py
parentf98b8470de2e0225befc5a39ef20ed5e4f7880c1 (diff)
downloadpython-novaclient-9df9aff6fc921e7d4b5439f6bde76384f1d31d2f.tar.gz
Rename interface to endpoint_type
'interface' argument was not described anywhere in novaclient's docs, but since we transmit all additional (unexpected) arguments to SessionClient implementation, keystoneclient was able to use it. Change-Id: Id7200a6df416694173b9a02206c53cef984f0fec
Diffstat (limited to 'novaclient/client.py')
-rw-r--r--novaclient/client.py19
1 files changed, 17 insertions, 2 deletions
diff --git a/novaclient/client.py b/novaclient/client.py
index c7dbd218..4cc5db2e 100644
--- a/novaclient/client.py
+++ b/novaclient/client.py
@@ -690,7 +690,6 @@ def _construct_http_client(api_version=None,
endpoint_type='publicURL',
http_log_debug=False,
insecure=False,
- interface=None,
os_cache=False,
password=None,
project_id=None,
@@ -714,7 +713,7 @@ def _construct_http_client(api_version=None,
return SessionClient(api_version=api_version,
auth=auth,
endpoint_override=endpoint_override,
- interface=interface or endpoint_type,
+ interface=endpoint_type,
region_name=region_name,
service_name=service_name,
service_type=service_type,
@@ -884,6 +883,22 @@ def Client(version, username=None, password=None, project_id=None,
_check_arguments(kwargs, "Ocata", "bypass_url",
right_name="endpoint_override")
_check_arguments(kwargs, "Ocata", "api_key", right_name="password")
+ # NOTE(andreykurilin): OpenStack projects use two variables with one
+ # meaning: 'endpoint_type' and 'interface'. 'endpoint_type' is an old
+ # name which was used by most OpenStack clients. Later it was replaced by
+ # 'interface' in keystone and later some other clients switched to new
+ # variable name too. In case of novaclient, there is no need to switch to
+ # 'interface' variable name due too several reasons:
+ # - novaclient uses 'endpoint_type' variable name long time ago and
+ # there is no real reasons to switch to new name;
+ # - 'interface' argument is used in several shell subcommands
+ # (for example in `nova floating-ip-bulk-create`), so we will need to
+ # modify these subcommands to not conflict with global flag
+ # 'interface'
+ # Actually, novaclient did not accept 'interface' before, but since we
+ # allow additional arguments(kwargs), someone can use this variable name
+ # and face issue about unexpected behavior.
+ _check_arguments(kwargs, "Ocata", "interface", right_name="endpoint_type")
api_version, client_class = _get_client_class_and_version(version)
kwargs.pop("direct_use", None)