From 90a1c65f3ac90b1077eb3ea2f5fbe8a039ee9290 Mon Sep 17 00:00:00 2001 From: Dean Troyer Date: Mon, 20 Aug 2012 18:02:30 -0500 Subject: Update compute client bits * add server create, delete, pause, reboot, rebuild resume, suspend, unpause commands Change-Id: I728ec199e4562bd621c3a73106c90d8b790b459a --- openstackclient/compute/client.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'openstackclient/compute/client.py') 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, -- cgit v1.2.1