Skip to content

Commit c513f05

Browse files
committed
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
1 parent 1a2bb48 commit c513f05

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

openstackclient/compute/client.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,12 @@ def make_client(instance):
4242
except ImportError:
4343
from novaclient.v1_1.contrib import list_extensions
4444

45-
compute_client = nova_client.get_client_class(
46-
instance._api_version[API_NAME],
47-
)
48-
LOG.debug('Instantiating compute client: %s', compute_client)
45+
if _compute_api_version is not None:
46+
version = _compute_api_version
47+
else:
48+
version = instance._api_version[API_NAME]
49+
50+
LOG.debug('Instantiating compute client for V%s' % version)
4951

5052
# Set client http_log_debug to True if verbosity level is high enough
5153
http_log_debug = utils.get_effective_log_level() <= logging.DEBUG
@@ -55,10 +57,8 @@ def make_client(instance):
5557
# Remember interface only if it is set
5658
kwargs = utils.build_kwargs_dict('endpoint_type', instance._interface)
5759

58-
if _compute_api_version is not None:
59-
kwargs.update({'api_version': _compute_api_version})
60-
61-
client = compute_client(
60+
client = nova_client.Client(
61+
version,
6262
session=instance.session,
6363
extensions=extensions,
6464
http_log_debug=http_log_debug,

0 commit comments

Comments
 (0)