summaryrefslogtreecommitdiff
path: root/openstackclient/compute/client.py
diff options
context:
space:
mode:
authorDean Troyer <dtroyer@gmail.com>2012-08-20 18:02:30 -0500
committerDean Troyer <dtroyer@gmail.com>2012-09-05 16:06:49 -0500
commit90a1c65f3ac90b1077eb3ea2f5fbe8a039ee9290 (patch)
tree1bdfc6c4b38660cc0297fa2d4f33cf66730ac808 /openstackclient/compute/client.py
parent8010e773accce2d24c04659c88ac0c040c9a1932 (diff)
downloadpython-openstackclient-90a1c65f3ac90b1077eb3ea2f5fbe8a039ee9290.tar.gz
Update compute client bits
* add server create, delete, pause, reboot, rebuild resume, suspend, unpause commands Change-Id: I728ec199e4562bd621c3a73106c90d8b790b459a
Diffstat (limited to 'openstackclient/compute/client.py')
-rw-r--r--openstackclient/compute/client.py17
1 files changed, 13 insertions, 4 deletions
diff --git a/openstackclient/compute/client.py b/openstackclient/compute/client.py
index a59b6e00..3c17b17a 100644
--- a/openstackclient/compute/client.py
+++ b/openstackclient/compute/client.py
@@ -17,19 +17,28 @@
import logging
-from novaclient import client as nova_client
+from openstackclient.common import exceptions as exc
+from openstackclient.common import utils
LOG = logging.getLogger(__name__)
API_NAME = 'compute'
+API_VERSIONS = {
+ '1.1': 'novaclient.v1_1.client.Client',
+ '2': 'novaclient.v1_1.client.Client',
+}
def make_client(instance):
"""Returns a compute service client.
"""
- LOG.debug('instantiating compute client')
- client = nova_client.Client(
- version=instance._api_version[API_NAME],
+ compute_client = utils.get_client_class(
+ API_NAME,
+ instance._api_version[API_NAME],
+ API_VERSIONS,
+ )
+ LOG.debug('instantiating compute client: %s' % compute_client)
+ client = compute_client(
username=instance._username,
api_key=instance._password,
project_id=instance._tenant_name,