diff --git a/kloudbuster/kloudbuster.py b/kloudbuster/kloudbuster.py index 35595fa..fed7d7c 100755 --- a/kloudbuster/kloudbuster.py +++ b/kloudbuster/kloudbuster.py @@ -50,7 +50,7 @@ def create_keystone_client(creds): Return the keystone client and auth URL given a credential """ creds = creds.get_credentials() - return (keystoneclient.Client(**creds), creds['auth_url']) + return (keystoneclient.Client(endpoint_type='publicURL', **creds), creds['auth_url']) class Kloud(object): def __init__(self, scale_cfg, cred, reusing_tenants, testing_side=False): diff --git a/kloudbuster/tenant.py b/kloudbuster/tenant.py index 98942c9..7d0a4e2 100644 --- a/kloudbuster/tenant.py +++ b/kloudbuster/tenant.py @@ -44,12 +44,7 @@ class Tenant(object): LOG.info("Using tenant: " + self.tenant_name) # Only admin can retrive the object via Keystone API self.tenant_object = None - try: - # Try to see if we have the admin access to retrive the tenant id using - # tenant name directly from keystone - self.tenant_id = self.kloud.keystone.tenants.find(name=self.tenant_name).id - except Exception: - self.tenant_id = self.kloud.keystone.tenant_id + self.tenant_id = self.kloud.keystone.tenant_id self.tenant_quota = tenant_quota self.reusing_users = reusing_users diff --git a/kloudbuster/users.py b/kloudbuster/users.py index 679e52c..e3057d7 100644 --- a/kloudbuster/users.py +++ b/kloudbuster/users.py @@ -197,7 +197,7 @@ class User(object): creden['tenant_name'] = self.tenant.tenant_name # Create the neutron client to be used for all operations - self.neutron_client = neutronclient.Client(**creden) + self.neutron_client = neutronclient.Client(endpoint_type='publicURL', **creden) # Create a new nova and cinder client for this User with correct credentials creden_nova = {} @@ -207,8 +207,8 @@ class User(object): creden_nova['project_id'] = self.tenant.tenant_name creden_nova['version'] = 2 - self.nova_client = Client(**creden_nova) - self.cinder_client = cinderclient.Client(**creden_nova) + self.nova_client = Client(endpoint_type='publicURL', **creden_nova) + self.cinder_client = cinderclient.Client(endpoint_type='publicURL', **creden_nova) if self.tenant.kloud.reusing_tenants: self.check_resources_quota()