diff options
author | Cédric Ollivier <ollivier.cedric@gmail.com> | 2018-07-11 09:18:56 +0200 |
---|---|---|
committer | Cédric Ollivier <cedric.ollivier@orange.com> | 2018-07-11 13:58:56 +0200 |
commit | 1e7083b512c3d821dba009acb3fec84ea63fb8a6 (patch) | |
tree | 85ee00feacbe220534bf0a77cf0c780163d2d42a | |
parent | 3eb3153d9c28b9bf8b0afddb4b918af7e34bcdbe (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>
(cherry picked from commit 4f89564b20e9c3462614706a616d469540631786)
-rw-r--r-- | functest/core/tenantnetwork.py | 5 |
1 files changed, 4 insertions, 1 deletions
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) |