summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2018-11-23 09:38:34 +0100
committerCédric Ollivier <cedric.ollivier@orange.com>2018-11-24 09:53:07 +0100
commitfb917f9ce3ce3555b776db4678e2528ffc9dd6e8 (patch)
tree5433d24a7c5afd8f60b50b6853f46f4b8fdef111
parent0e3b125cd07a2c6c538b971044f5f013abf6e5d6 (diff)
Stop cleaning role
Functest may create default role if member doesn't exist. It cannot be removed at the end of the testcase as it raises side effects when testing in parallel. Change-Id: Ief552f450a34b4aeda045b0c5d5f237ed77f3643 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com> (cherry picked from commit 79771aaf65fd6eb93e318c472d72d5fad6561bf1)
-rw-r--r--functest/core/tenantnetwork.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/functest/core/tenantnetwork.py b/functest/core/tenantnetwork.py
index e03740767..4298ea981 100644
--- a/functest/core/tenantnetwork.py
+++ b/functest/core/tenantnetwork.py
@@ -46,7 +46,6 @@ class NewProject(object):
self.user = None
self.password = None
self.domain = None
- self.role = None
self.role_name = None
self.default_member = env.get('NEW_USER_ROLE')
@@ -78,9 +77,9 @@ class NewProject(object):
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)
- self.role_name = self.role.name
- self.__logger.debug("role: %s", self.role)
+ role = self.orig_cloud.create_role(self.default_member)
+ self.role_name = role.name
+ self.__logger.debug("role: %s", role)
self.orig_cloud.grant_role(
self.role_name, user=self.user.id, project=self.project.id,
domain=self.domain.id)
@@ -104,8 +103,6 @@ class NewProject(object):
self.orig_cloud.delete_user(self.user.id)
if self.project:
self.orig_cloud.delete_project(self.project.id)
- if self.role:
- self.orig_cloud.delete_role(self.role.id)
secgroups = self.orig_cloud.list_security_groups(
filters={'name': 'default',
'project_id': self.project.id})