diff options
author | Cédric Ollivier <cedric.ollivier@orange.com> | 2018-06-24 19:43:01 +0200 |
---|---|---|
committer | Cédric Ollivier <cedric.ollivier@orange.com> | 2018-07-03 19:42:53 +0200 |
commit | d87a9046050fcd890b3d604f1035e6c514d3c437 (patch) | |
tree | c724bc3cca27c388b2f4103db6ce8a8364526c8f | |
parent | 5247619cec8fc37fcf5b44d7d2d02c31db8c5d42 (diff) |
Force the use of public endpoints in shaker.py
It now leverages on the new user created and gets the public endpoint.
Change-Id: Iead106e614a73708cb13e33b49a2f438766a3056
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
(cherry picked from commit 192cdecb5d7ed16641d1c5520450be38e9e0f166)
-rw-r--r-- | functest/core/tenantnetwork.py | 16 |
1 files 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()) |