~corey.bryant/charm-helpers/stable-newton

« back to all changes in this revision

Viewing changes to charmhelpers/contrib/openstack/amulet/utils.py

  • Committer: James Page
  • Date: 2016-10-04 14:04:01 UTC
  • Revision ID: james.page@ubuntu.com-20161004140401-izn5bavs3p3apg43
Re-instate previous revert; its OK when tests don't race

Show diffs side-by-side

added added

removed removed

Lines of Context:
306
306
                                  password, tenant):
307
307
        """Authenticates admin user with cinder."""
308
308
        # NOTE(beisner): cinder python client doesn't accept tokens.
309
 
        service_ip = \
310
 
            keystone_sentry.relation('shared-db',
311
 
                                     'mysql:shared-db')['private-address']
312
 
        ept = "http://{}:5000/v2.0".format(service_ip.strip().decode('utf-8'))
 
309
        keystone_ip = keystone_sentry.info['private-address']
 
310
        ept = "http://{}:5000/v2.0".format(keystone_ip.strip().decode('utf-8'))
313
311
        return cinder_client.Client(username, password, tenant, ept)
314
312
 
315
313
    def authenticate_keystone_admin(self, keystone_sentry, user, password,
319
317
        self.log.debug('Authenticating keystone admin...')
320
318
        unit = keystone_sentry
321
319
        if not keystone_ip:
322
 
            keystone_ip = unit.relation('shared-db',
323
 
                                        'mysql:shared-db')['private-address']
 
320
            keystone_ip = keystone_sentry.info['private-address']
 
321
 
324
322
        base_ep = "http://{}:35357".format(keystone_ip.strip().decode('utf-8'))
325
323
        if not api_version or api_version == 2:
326
324
            ep = base_ep + "/v2.0"