]> review.fuel-infra Code Review - openstack-build/heat-build.git/commitdiff
Fix importing of novaclient exceptions
authorZane Bitter <zbitter@redhat.com>
Mon, 17 Dec 2012 16:11:03 +0000 (17:11 +0100)
committerZane Bitter <zbitter@redhat.com>
Mon, 17 Dec 2012 16:11:13 +0000 (17:11 +0100)
Broken by 3c702e38e9a51a15a8d1626b60f610c75cb1f8b7

Also, use novaclient's own mechanism for selecting the correct API version;
don't go fishing in the internals.

Change-Id: I296312f185735026587ba9849343aa79177856a3
Signed-off-by: Zane Bitter <zbitter@redhat.com>
heat/engine/clients.py

index c28f796e9c02bc2c0151fd82ddb1002ed9ab2fde..5868313c48691cba3f6c12f3abef8b38e8c092e4 100644 (file)
@@ -19,7 +19,7 @@ logger = logging.getLogger(__name__)
 
 
 from heat.common import heat_keystoneclient as hkc
-from novaclient.v1_1 import client as novaclient
+from novaclient import client as novaclient
 try:
     from swiftclient import client as swiftclient
 except ImportError:
@@ -80,13 +80,13 @@ class Clients(object):
             # Workaround for issues with python-keyring, need no_cache=True
             # ref https://bugs.launchpad.net/python-novaclient/+bug/1020238
             # TODO(shardy): May be able to remove when the bug above is fixed
-            client = novaclient.Client(no_cache=True, **args)
+            client = novaclient.Client(1.1, no_cache=True, **args)
             client.authenticate()
             self._nova[service_type] = client
         except TypeError:
             # for compatibility with essex, which doesn't have no_cache=True
             # TODO(shardy): remove when we no longer support essex
-            client = novaclient.Client(**args)
+            client = novaclient.Client(1.1, **args)
             client.authenticate()
             self._nova[service_type] = client