diff options
-rw-r--r-- | functest/opnfv_tests/openstack/shaker/shaker.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/functest/opnfv_tests/openstack/shaker/shaker.py b/functest/opnfv_tests/openstack/shaker/shaker.py index 4f774483b..51244e2d5 100644 --- a/functest/opnfv_tests/openstack/shaker/shaker.py +++ b/functest/opnfv_tests/openstack/shaker/shaker.py @@ -58,8 +58,14 @@ class Shaker(singlevm.SingleVm2): assert self.ssh endpoint = self.get_public_auth_url(self.orig_cloud) self.__logger.debug("keystone endpoint: %s", endpoint) + if self.orig_cloud.get_role("admin"): + role_name = "admin" + elif self.orig_cloud.get_role("Admin"): + role_name = "Admin" + else: + raise Exception("Cannot detect neither admin nor Admin") self.orig_cloud.grant_role( - "admin", user=self.project.user.id, + role_name, user=self.project.user.id, project=self.project.project.id, domain=self.project.domain.id) if not self.orig_cloud.get_role("heat_stack_owner"): |