From d87a9046050fcd890b3d604f1035e6c514d3c437 Mon Sep 17 00:00:00 2001 From: Cédric Ollivier Date: Sun, 24 Jun 2018 19:43:01 +0200 Subject: Force the use of public endpoints in shaker.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It now leverages on the new user created and gets the public endpoint. Change-Id: Iead106e614a73708cb13e33b49a2f438766a3056 Signed-off-by: Cédric Ollivier (cherry picked from commit 192cdecb5d7ed16641d1c5520450be38e9e0f166) --- functest/core/tenantnetwork.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/functest/core/tenantnetwork.py b/functest/core/tenantnetwork.py index 5458480c9..d005bc3ab 100644 --- a/functest/core/tenantnetwork.py +++ b/functest/core/tenantnetwork.py @@ -44,34 +44,36 @@ class NewProject(object): self.guid = guid self.project = None self.user = None + self.password = None + self.domain = None def create(self): """Create projects/users""" assert self.orig_cloud assert self.case_name - password = str(uuid.uuid4()) - domain = self.orig_cloud.get_domain( + self.password = str(uuid.uuid4()) + self.domain = self.orig_cloud.get_domain( name_or_id=self.orig_cloud.auth.get( "project_domain_name", "Default")) self.project = self.orig_cloud.create_project( name='{}-project_{}'.format(self.case_name, self.guid), description="Created by OPNFV Functest: {}".format( self.case_name), - domain_id=domain.id) + domain_id=self.domain.id) self.__logger.debug("project: %s", self.project) self.user = self.orig_cloud.create_user( name='{}-user_{}'.format(self.case_name, self.guid), - password=password, - domain_id=domain.id) + password=self.password, + domain_id=self.domain.id) self.__logger.debug("user: %s", self.user) self.orig_cloud.grant_role( "_member_", user=self.user.id, project=self.project.id, - domain=domain.id) + domain=self.domain.id) osconfig = os_client_config.config.OpenStackConfig() osconfig.cloud_config[ 'clouds']['envvars']['project_name'] = self.project.name osconfig.cloud_config['clouds']['envvars']['username'] = self.user.name - osconfig.cloud_config['clouds']['envvars']['password'] = password + osconfig.cloud_config['clouds']['envvars']['password'] = self.password self.cloud = shade.OpenStackCloud( cloud_config=osconfig.get_one_cloud()) -- cgit 1.2.3-korg