Enable tenant isolation for the boto tests
This commit enables using tenant isolation on the boto tests. It also
replaces duplicate Manager() create calls by doing this in the base
boto test class.
Change-Id: Icb018631dcda0753218af8cf1cc4ad461160072c
diff --git a/tempest/test.py b/tempest/test.py
index 61d1311..ab0aa9a 100644
--- a/tempest/test.py
+++ b/tempest/test.py
@@ -273,7 +273,7 @@
level=None))
@classmethod
- def get_client_manager(cls):
+ def get_client_manager(cls, interface=None):
"""
Returns an Openstack client manager
"""
@@ -285,12 +285,27 @@
force_tenant_isolation):
creds = cls.isolated_creds.get_primary_creds()
username, tenant_name, password = creds
- os = clients.Manager(username=username,
- password=password,
- tenant_name=tenant_name,
- interface=cls._interface)
+ if getattr(cls, '_interface', None):
+ os = clients.Manager(username=username,
+ password=password,
+ tenant_name=tenant_name,
+ interface=cls._interface)
+ elif interface:
+ os = clients.Manager(username=username,
+ password=password,
+ tenant_name=tenant_name,
+ interface=interface)
+ else:
+ os = clients.Manager(username=username,
+ password=password,
+ tenant_name=tenant_name)
else:
- os = clients.Manager(interface=cls._interface)
+ if getattr(cls, '_interface', None):
+ os = clients.Manager(interface=cls._interface)
+ elif interface:
+ os = clients.Manager(interface=interface)
+ else:
+ os = clients.Manager()
return os
@classmethod