Merge lp:~corey.bryant/charm-helpers/ocata-novaclient into lp:charm-helpers

Proposed by Corey Bryant
Status: Merged
Merged at revision: 698
Proposed branch: lp:~corey.bryant/charm-helpers/ocata-novaclient
Merge into: lp:charm-helpers
Diff against target: 29 lines (+9/-3)
1 file modified
charmhelpers/contrib/openstack/amulet/utils.py (+9/-3)
To merge this branch: bzr merge lp:~corey.bryant/charm-helpers/ocata-novaclient
Reviewer Review Type Date Requested Status
Ryan Beisner (community) Approve
Review via email: mp+318414@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Ryan Beisner (1chb1n) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'charmhelpers/contrib/openstack/amulet/utils.py'
2--- charmhelpers/contrib/openstack/amulet/utils.py 2017-02-09 16:05:18 +0000
3+++ charmhelpers/contrib/openstack/amulet/utils.py 2017-02-27 22:13:35 +0000
4@@ -32,6 +32,7 @@
5 from novaclient import exceptions
6
7 import novaclient.client as nova_client
8+import novaclient
9 import pika
10 import swiftclient
11
12@@ -434,9 +435,14 @@
13 self.log.debug('Authenticating nova user ({})...'.format(user))
14 ep = keystone.service_catalog.url_for(service_type='identity',
15 endpoint_type='publicURL')
16- return nova_client.Client(NOVA_CLIENT_VERSION,
17- username=user, api_key=password,
18- project_id=tenant, auth_url=ep)
19+ if novaclient.__version__[0] >= "7":
20+ return nova_client.Client(NOVA_CLIENT_VERSION,
21+ username=user, password=password,
22+ project_name=tenant, auth_url=ep)
23+ else:
24+ return nova_client.Client(NOVA_CLIENT_VERSION,
25+ username=user, api_key=password,
26+ project_id=tenant, auth_url=ep)
27
28 def authenticate_swift_user(self, keystone, user, password, tenant):
29 """Authenticates a regular user with swift api."""

Subscribers

People subscribed via source and target branches