Skip to content

Commit cd14009

Browse files
Jenkinsopenstack-gerrit
authored andcommitted
Merge "Update compute client bits"
2 parents 2c512ac + 90a1c65 commit cd14009

3 files changed

Lines changed: 580 additions & 44 deletions

File tree

‎openstackclient/compute/client.py‎

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,28 @@
1717

1818
import logging
1919

20-
from novaclient import client as nova_client
20+
from openstackclient.common import exceptions as exc
21+
from openstackclient.common import utils
2122

2223
LOG = logging.getLogger(__name__)
2324

2425
API_NAME = 'compute'
26+
API_VERSIONS = {
27+
'1.1': 'novaclient.v1_1.client.Client',
28+
'2': 'novaclient.v1_1.client.Client',
29+
}
2530

2631

2732
def make_client(instance):
2833
"""Returns a compute service client.
2934
"""
30-
LOG.debug('instantiating compute client')
31-
client = nova_client.Client(
32-
version=instance._api_version[API_NAME],
35+
compute_client = utils.get_client_class(
36+
API_NAME,
37+
instance._api_version[API_NAME],
38+
API_VERSIONS,
39+
)
40+
LOG.debug('instantiating compute client: %s' % compute_client)
41+
client = compute_client(
3342
username=instance._username,
3443
api_key=instance._password,
3544
project_id=instance._tenant_name,

0 commit comments

Comments
 (0)