diff options
author | Cedric Ollivier <cedric.ollivier@orange.com> | 2018-09-04 08:00:00 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2018-09-04 08:00:00 +0000 |
commit | fb735dae4c936c80107037268cb5e48231b31d8f (patch) | |
tree | 3e31c877e0547ac61c5443cfa48dc019830716d3 | |
parent | 5448462d7aa342c752196bb8ac17598d98a32088 (diff) | |
parent | 92ba2d7f3bbbecebcd4214bc9b8682d2b6ce87e9 (diff) |
Merge "Create network via admin user"
-rw-r--r-- | functest/core/singlevm.py | 1 | ||||
-rw-r--r-- | functest/core/tenantnetwork.py | 15 |
2 files changed, 11 insertions, 5 deletions
diff --git a/functest/core/singlevm.py b/functest/core/singlevm.py index 78f8ab9d0..71ed0690d 100644 --- a/functest/core/singlevm.py +++ b/functest/core/singlevm.py @@ -58,7 +58,6 @@ class VmReady1(tenantnetwork.TenantNetwork1): if "case_name" not in kwargs: kwargs["case_name"] = 'vmready1' super(VmReady1, self).__init__(**kwargs) - self.orig_cloud = self.cloud self.image = None self.flavor = None diff --git a/functest/core/tenantnetwork.py b/functest/core/tenantnetwork.py index a96484f28..9f5913c70 100644 --- a/functest/core/tenantnetwork.py +++ b/functest/core/tenantnetwork.py @@ -134,9 +134,10 @@ class TenantNetwork1(testcase.TestCase): getattr(config.CONF, 'dir_results'), self.case_name) try: cloud_config = os_client_config.get_config() - self.cloud = shade.OpenStackCloud(cloud_config=cloud_config) + self.cloud = self.orig_cloud = shade.OpenStackCloud( + cloud_config=cloud_config) except Exception: # pylint: disable=broad-except - self.cloud = None + self.cloud = self.orig_cloud = None self.ext_net = None self.__logger.exception("Cannot connect to Cloud") try: @@ -205,9 +206,15 @@ class TenantNetwork1(testcase.TestCase): if hasattr(config.CONF, '{}_segmentation_id'.format(self.case_name)): provider["segmentation_id"] = getattr( config.CONF, '{}_segmentation_id'.format(self.case_name)) - self.network = self.cloud.create_network( + domain = self.orig_cloud.get_domain( + name_or_id=self.orig_cloud.auth.get( + "project_domain_name", "Default")) + project = self.orig_cloud.get_project( + self.cloud.auth['project_name'], + domain_id=domain.id) + self.network = self.orig_cloud.create_network( '{}-net_{}'.format(self.case_name, self.guid), - provider=provider, + provider=provider, project_id=project.id, shared=self.shared_network) self.__logger.debug("network: %s", self.network) |