From 61138bfec980625bec6c219b9e27685c281e5965 Mon Sep 17 00:00:00 2001 From: Cédric Ollivier Date: Thu, 12 Aug 2021 16:41:38 +0200 Subject: Update to Alpine 3.14 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It also fixes lots of new pylint warnings. Change-Id: I3376aee5649596c53bc2941ad4d8e0674a2967fe Signed-off-by: Cédric Ollivier --- functest/opnfv_tests/vnf/ims/cloudify_ims.py | 10 +++++----- functest/opnfv_tests/vnf/ims/heat_ims.py | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'functest/opnfv_tests/vnf/ims') diff --git a/functest/opnfv_tests/vnf/ims/cloudify_ims.py b/functest/opnfv_tests/vnf/ims/cloudify_ims.py index d937cc052..4428990a8 100644 --- a/functest/opnfv_tests/vnf/ims/cloudify_ims.py +++ b/functest/opnfv_tests/vnf/ims/cloudify_ims.py @@ -53,14 +53,14 @@ class CloudifyIms(cloudify.Cloudify): """Initialize CloudifyIms testcase object.""" if "case_name" not in kwargs: kwargs["case_name"] = "cloudify_ims" - super(CloudifyIms, self).__init__(**kwargs) + super().__init__(**kwargs) # Retrieve the configuration try: self.config = getattr( config.CONF, 'vnf_{}_config'.format(self.case_name)) - except Exception: - raise Exception("VNF config file not found") + except Exception as exc: + raise Exception("VNF config file not found") from exc self.case_dir = pkg_resources.resource_filename( 'functest', 'opnfv_tests/vnf/ims') @@ -114,7 +114,7 @@ class CloudifyIms(cloudify.Cloudify): network, security group, fip, VM creation """ - assert super(CloudifyIms, self).execute() == 0 + assert super().execute() == 0 start_time = time.time() self.orig_cloud.set_network_quotas( self.project.project.name, @@ -259,4 +259,4 @@ class CloudifyIms(cloudify.Cloudify): self.cloud.delete_image(self.image_alt) if self.flavor_alt: self.orig_cloud.delete_flavor(self.flavor_alt.id) - super(CloudifyIms, self).clean() + super().clean() diff --git a/functest/opnfv_tests/vnf/ims/heat_ims.py b/functest/opnfv_tests/vnf/ims/heat_ims.py index 4edb2ddd9..60478adcb 100644 --- a/functest/opnfv_tests/vnf/ims/heat_ims.py +++ b/functest/opnfv_tests/vnf/ims/heat_ims.py @@ -57,14 +57,14 @@ class HeatIms(singlevm.VmReady2): """Initialize HeatIms testcase object.""" if "case_name" not in kwargs: kwargs["case_name"] = "heat_ims" - super(HeatIms, self).__init__(**kwargs) + super().__init__(**kwargs) # Retrieve the configuration try: self.config = getattr( config.CONF, 'vnf_{}_config'.format(self.case_name)) - except Exception: - raise Exception("VNF config file not found") + except Exception as exc: + raise Exception("VNF config file not found") from exc self.case_dir = pkg_resources.resource_filename( 'functest', 'opnfv_tests/vnf/ims') @@ -137,7 +137,7 @@ class HeatIms(singlevm.VmReady2): status = testcase.TestCase.EX_RUN_ERROR try: assert self.cloud - assert super(HeatIms, self).run( + assert super().run( **kwargs) == testcase.TestCase.EX_OK self.result = 0 if not self.execute(): @@ -247,6 +247,6 @@ class HeatIms(singlevm.VmReady2): pass except Exception: # pylint: disable=broad-except self.__logger.exception("Cannot clean stack ressources") - super(HeatIms, self).clean() + super().clean() if self.role: self.orig_cloud.delete_role(self.role.id) -- cgit 1.2.3-korg