summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCédric Ollivier <ollivier.cedric@gmail.com>2018-07-11 09:18:56 +0200
committerCédric Ollivier <cedric.ollivier@orange.com>2018-07-11 09:24:33 +0200
commit4f89564b20e9c3462614706a616d469540631786 (patch)
tree9dd853d2de5667e56008e9e78208b5481a29d118
parent3f336efd9daf442b5c13954a6df830b09228d576 (diff)
Try to get Member or member role
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 <cedric.ollivier@orange.com>
-rw-r--r--functest/core/tenantnetwork.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/functest/core/tenantnetwork.py b/functest/core/tenantnetwork.py
index 6efb7abd7..da4ff7482 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)