From 01efa1e4229157b46d352bce202ed4192992dd3f Mon Sep 17 00:00:00 2001 From: Cédric Ollivier Date: Fri, 26 Jan 2018 09:49:49 +0100 Subject: Fix last Pylint error in Functest MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It also fixes all pylint warnings in router and the related unit tests. tox.ini is updated to ensure that no error is introduced. Change-Id: Iddd74b0dac7b6581d72b04369140006c9e19f998 Signed-off-by: Cédric Ollivier --- .../opnfv_tests/vnf/router/cloudify_vrouter.py | 25 +++++++--------------- 1 file changed, 8 insertions(+), 17 deletions(-) (limited to 'functest/opnfv_tests/vnf/router/cloudify_vrouter.py') diff --git a/functest/opnfv_tests/vnf/router/cloudify_vrouter.py b/functest/opnfv_tests/vnf/router/cloudify_vrouter.py index f2cd63fb2..1596860d8 100644 --- a/functest/opnfv_tests/vnf/router/cloudify_vrouter.py +++ b/functest/opnfv_tests/vnf/router/cloudify_vrouter.py @@ -7,6 +7,8 @@ # which accompanies this distribution, and is available at # http://www.apache.org/licenses/LICENSE-2.0 +# pylint: disable=missing-docstring + """vrouter testcase implementation.""" import logging @@ -50,6 +52,7 @@ __author__ = "Shuya Nakama " class CloudifyVrouter(vrouter_base.VrouterOnBoardingBase): + # pylint: disable=too-many-instance-attributes """vrouter testcase deployed with Cloudify Orchestrator.""" __logger = logging.getLogger(__name__) @@ -129,6 +132,7 @@ class CloudifyVrouter(vrouter_base.VrouterOnBoardingBase): self.created_object.append(image_creator) def deploy_orchestrator(self): + # pylint: disable=too-many-locals,too-many-statements """ Deploy Cloudify Manager. network, security group, fip, VM creation @@ -408,7 +412,7 @@ class CloudifyVrouter(vrouter_base.VrouterOnBoardingBase): try: cfy_client.executions.cancel(execution['id'], force=True) - except: # pylint: disable=broad-except + except Exception: # pylint: disable=broad-except self.__logger.warn("Can't cancel the current exec") execution = cfy_client.executions.start( @@ -419,27 +423,14 @@ class CloudifyVrouter(vrouter_base.VrouterOnBoardingBase): wait_for_execution(cfy_client, execution, self.__logger) cfy_client.deployments.delete(self.vnf['descriptor'].get('name')) cfy_client.blueprints.delete(self.vnf['descriptor'].get('name')) - except: # pylint: disable=broad-except + except Exception: # pylint: disable=broad-except self.__logger.warn("Some issue during the undeployment ..") self.__logger.warn("Tenant clean continue ..") - - self.__logger.info('Remove the cloudify manager OS object ..') - for creator in reversed(self.created_object): - try: - creator.clean() - except Exception as exc: - self.logger.error('Unexpected error cleaning - %s', exc) - super(CloudifyVrouter, self).clean() - def run(self, **kwargs): - """Execute CloudifyVrouter test case.""" - return super(CloudifyVrouter, self).run(**kwargs) - def get_vnf_info_list(self, target_vnf_name): - return self.util.get_vnf_info_list(self.cfy_manager_ip, - self.deployment_name, - target_vnf_name) + return self.util.get_vnf_info_list( + self.cfy_manager_ip, self.deployment_name, target_vnf_name) # ---------------------------------------------------------- -- cgit 1.2.3-korg