Merge lp:~ajkavanagh/charm-helpers/fix-novaclient-v1_1 into lp:charm-helpers

Proposed by Alex Kavanagh
Status: Merged
Merged at revision: 548
Proposed branch: lp:~ajkavanagh/charm-helpers/fix-novaclient-v1_1
Merge into: lp:charm-helpers
Diff against target: 31 lines (+5/-2)
1 file modified
charmhelpers/contrib/openstack/amulet/utils.py (+5/-2)
To merge this branch: bzr merge lp:~ajkavanagh/charm-helpers/fix-novaclient-v1_1
Reviewer Review Type Date Requested Status
Liam Young (community) Approve
Review via email: mp+289050@code.launchpad.net

Description of the change

  Fix lp:1555643 - c.o.amulet.utils imports removed novaclient.v1_1 module

  As per http://docs.openstack.org/developer/python-novaclient/api.html
  the novaclient module needs to be imported as:

  from novaclient import client
  c = client.Client(VERSION, ...)

  as opposed to

  from novaclient.VERSION import client
  c = client.Client(...)

To post a comment you must log in.
Revision history for this message
Liam Young (gnuoy) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'charmhelpers/contrib/openstack/amulet/utils.py'
--- charmhelpers/contrib/openstack/amulet/utils.py 2016-03-11 10:58:21 +0000
+++ charmhelpers/contrib/openstack/amulet/utils.py 2016-03-15 14:18:58 +0000
@@ -31,7 +31,7 @@
31from keystoneclient import session as keystone_session31from keystoneclient import session as keystone_session
32from keystoneclient.v3 import client as keystone_client_v332from keystoneclient.v3 import client as keystone_client_v3
3333
34import novaclient.v1_1.client as nova_client34import novaclient.client as nova_client
35import pika35import pika
36import swiftclient36import swiftclient
3737
@@ -42,6 +42,8 @@
42DEBUG = logging.DEBUG42DEBUG = logging.DEBUG
43ERROR = logging.ERROR43ERROR = logging.ERROR
4444
45NOVA_CLIENT_VERSION = "2"
46
4547
46class OpenStackAmuletUtils(AmuletUtils):48class OpenStackAmuletUtils(AmuletUtils):
47 """OpenStack amulet utilities.49 """OpenStack amulet utilities.
@@ -249,7 +251,8 @@
249 self.log.debug('Authenticating nova user ({})...'.format(user))251 self.log.debug('Authenticating nova user ({})...'.format(user))
250 ep = keystone.service_catalog.url_for(service_type='identity',252 ep = keystone.service_catalog.url_for(service_type='identity',
251 endpoint_type='publicURL')253 endpoint_type='publicURL')
252 return nova_client.Client(username=user, api_key=password,254 return nova_client.Client(NOVA_CLIENT_VERSION,
255 username=user, api_key=password,
253 project_id=tenant, auth_url=ep)256 project_id=tenant, auth_url=ep)
254257
255 def authenticate_swift_user(self, keystone, user, password, tenant):258 def authenticate_swift_user(self, keystone, user, password, tenant):

Subscribers

People subscribed via source and target branches