Stop using aliases for creds manager

Now that Tempest has stopped using aliases like cls.os
and cls.os_adm [0], Murano should do the same.

This patch normalizes the usage around os_admin, os_primary and
os_alt.

[0] https://review.openstack.org/#/c/457555/

Change-Id: I40e6cb8eec8e67f4dbe4f92d7216a3b0ebcd4a59
Related-Change-Id: I5f7164f7a7ec5d4380ca22885000caa0183a0bf7
This commit is contained in:
Felipe Monteiro 2017-04-26 22:56:41 +01:00
parent fc2d947521
commit 3f235e74d1
4 changed files with 24 additions and 20 deletions

View File

@ -80,11 +80,12 @@ class BaseArtifactsTest(base.BaseTestCase):
if not CONF.service_available.murano:
skip_msg = "Murano is disabled"
raise cls.skipException(skip_msg)
if not hasattr(cls, "os"):
if not hasattr(cls, "os_primary"):
creds = cls.get_configured_isolated_creds(type_of_creds='primary')
cls.os = clients.Manager(credentials=creds)
cls.artifacts_client = cls.os.artifacts_client
cls.application_catalog_client = cls.os.application_catalog_client
cls.os_primary = clients.Manager(credentials=creds)
cls.artifacts_client = cls.os_primary.artifacts_client
cls.application_catalog_client = \
cls.os_primary.application_catalog_client
@classmethod
def resource_cleanup(cls):

View File

@ -81,11 +81,12 @@ class BaseApplicationCatalogTest(base.BaseTestCase):
if not CONF.service_available.murano:
skip_msg = "Murano is disabled"
raise cls.skipException(skip_msg)
if not hasattr(cls, "os"):
if not hasattr(cls, "os_primary"):
creds = cls.get_configured_isolated_creds(type_of_creds='primary')
cls.os = clients.Manager(credentials=creds)
cls.application_catalog_client = cls.os.application_catalog_client
cls.artifacts_client = cls.os.artifacts_client
cls.os_primary = clients.Manager(credentials=creds)
cls.application_catalog_client = \
cls.os_primary.application_catalog_client
cls.artifacts_client = cls.os_primary.artifacts_client
@classmethod
def resource_cleanup(cls):
@ -122,7 +123,7 @@ class BaseApplicationCatalogAdminTest(BaseApplicationCatalogTest):
@classmethod
def resource_setup(cls):
cls.os = clients.Manager()
cls.os_primary = clients.Manager()
super(BaseApplicationCatalogAdminTest, cls).resource_setup()
@ -131,5 +132,5 @@ class BaseApplicationCatalogIsolatedAdminTest(BaseApplicationCatalogTest):
@classmethod
def resource_setup(cls):
creds = cls.get_configured_isolated_creds(type_of_creds='admin')
cls.os = clients.Manager(credentials=creds)
cls.os_primary = clients.Manager(credentials=creds)
super(BaseApplicationCatalogIsolatedAdminTest, cls).resource_setup()

View File

@ -76,14 +76,15 @@ class BaseServiceBrokerTest(base.BaseTestCase):
if not CONF.service_available.murano:
skip_msg = "Murano is disabled"
raise cls.skipException(skip_msg)
if not hasattr(cls, "os"):
if not hasattr(cls, "os_primary"):
cls.username = CONF.identity.username
cls.password = CONF.identity.password
cls.tenant_name = CONF.identity.tenant_name
cls.verify_nonempty(cls.username, cls.password, cls.tenant_name)
cls.os = clients.Manager()
cls.service_broker_client = cls.os.service_broker_client
cls.application_catalog_client = cls.os.application_catalog_client
cls.os_primary = clients.Manager()
cls.service_broker_client = cls.os_primary.service_broker_client
cls.application_catalog_client = \
cls.os_primary.application_catalog_client
def setUp(self):
super(BaseServiceBrokerTest, self).setUp()
@ -129,5 +130,5 @@ class BaseServiceBrokerAdminTest(BaseServiceBrokerTest):
@classmethod
def resource_setup(cls):
cls.os = clients.Manager()
cls.os_primary = clients.Manager()
super(BaseServiceBrokerAdminTest, cls).resource_setup()

View File

@ -88,14 +88,15 @@ class BaseApplicationCatalogScenarioTest(base.BaseTestCase):
if not CONF.service_available.murano:
skip_msg = "Murano is disabled"
raise cls.skipException(skip_msg)
if not hasattr(cls, "os"):
if not hasattr(cls, "os_primary"):
creds = cls.get_configured_isolated_creds(type_of_creds='primary')
cls.os = clients.Manager(credentials=creds)
cls.os_primary = clients.Manager(credentials=creds)
cls.services_manager = services_manager(creds)
cls.linux_image = CONF.application_catalog.linux_image
cls.application_catalog_client = cls.os.application_catalog_client
cls.artifacts_client = cls.os.artifacts_client
cls.application_catalog_client = \
cls.os_primary.application_catalog_client
cls.artifacts_client = cls.os_primary.artifacts_client
cls.servers_client = cls.services_manager.servers_client
cls.orchestration_client = cls.services_manager.orchestration_client
cls.snapshots_client = cls.services_manager.snapshots_v2_client
@ -374,7 +375,7 @@ class BaseApplicationCatalogScenarioIsolatedAdminTest(
@classmethod
def resource_setup(cls):
creds = cls.get_configured_isolated_creds(type_of_creds='admin')
cls.os = clients.Manager(credentials=creds)
cls.os_primary = clients.Manager(credentials=creds)
cls.services_manager = services_manager(creds)
super(BaseApplicationCatalogScenarioIsolatedAdminTest, cls).\
resource_setup()