diff options
| author | Andrey Kurilin <akurilin@mirantis.com> | 2015-09-09 18:00:50 +0300 |
|---|---|---|
| committer | Andrey Kurilin <akurilin@mirantis.com> | 2015-09-09 18:00:50 +0300 |
| commit | c513f05ce994a81044f787bd8460227f785ad8c1 (patch) | |
| tree | 7d656a636f66239fff17b7924b106711f0a64751 /openstackclient | |
| parent | 1a2bb4843237102f75a44ee70bb8d6680986c6e3 (diff) | |
| download | python-openstackclient-c513f05ce994a81044f787bd8460227f785ad8c1.tar.gz | |
Use novaclient.client.Client for initialization Nova client
`novaclient.client.Client` is a recommended entry point for novaclient.
It supports backward-compatibility and allows Nova-folks to change
interfaces of inner versioned clients classes.
Change-Id: Iaf20714f63c307f88a451759f041ca509fbcf6f8
Diffstat (limited to 'openstackclient')
| -rw-r--r-- | openstackclient/compute/client.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/openstackclient/compute/client.py b/openstackclient/compute/client.py index dd40b9a9..8ac5f324 100644 --- a/openstackclient/compute/client.py +++ b/openstackclient/compute/client.py @@ -42,10 +42,12 @@ def make_client(instance): except ImportError: from novaclient.v1_1.contrib import list_extensions - compute_client = nova_client.get_client_class( - instance._api_version[API_NAME], - ) - LOG.debug('Instantiating compute client: %s', compute_client) + if _compute_api_version is not None: + version = _compute_api_version + else: + version = instance._api_version[API_NAME] + + LOG.debug('Instantiating compute client for V%s' % version) # Set client http_log_debug to True if verbosity level is high enough http_log_debug = utils.get_effective_log_level() <= logging.DEBUG @@ -55,10 +57,8 @@ def make_client(instance): # Remember interface only if it is set kwargs = utils.build_kwargs_dict('endpoint_type', instance._interface) - if _compute_api_version is not None: - kwargs.update({'api_version': _compute_api_version}) - - client = compute_client( + client = nova_client.Client( + version, session=instance.session, extensions=extensions, http_log_debug=http_log_debug, |
