From 1e7083b512c3d821dba009acb3fec84ea63fb8a6 Mon Sep 17 00:00:00 2001 From: Cédric Ollivier Date: Wed, 11 Jul 2018 09:18:56 +0200 Subject: Try to get Member or member role MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Keystone roles are case insensitive and Apex declares member which couldn't be detected. Then conflict occured when creating the mandatory role [1]. It now searches the default role in lower case too. [1] https://build.opnfv.org/ci/view/functest/job/functest-apex-baremetal-daily-master/141/console Change-Id: I687ecfe768ab4717fdb42a135c4bf9b76733ffd9 Signed-off-by: Cédric Ollivier (cherry picked from commit 4f89564b20e9c3462614706a616d469540631786) --- functest/core/tenantnetwork.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/functest/core/tenantnetwork.py b/functest/core/tenantnetwork.py index 58fa5d2f8..df8c2af5b 100644 --- a/functest/core/tenantnetwork.py +++ b/functest/core/tenantnetwork.py @@ -68,7 +68,10 @@ class NewProject(object): domain_id=self.domain.id) self.__logger.debug("user: %s", self.user) try: - assert self.orig_cloud.get_role(self.default_member) + if not self.orig_cloud.get_role( + self.default_member) and not self.orig_cloud.get_role( + self.default_member.lower()): + raise Exception("Cannot detect {}".format(self.default_member)) except Exception: # pylint: disable=broad-except self.__logger.info("Creating default role %s", self.default_member) self.role = self.orig_cloud.create_role(self.default_member) -- cgit 1.2.3-korg