From e13e87d9d064c2427208104d3dacc9b8aee95b6e Mon Sep 17 00:00:00 2001 From: Cédric Ollivier Date: Fri, 15 Jun 2018 17:55:23 +0200 Subject: Fix pylint warnings in clearwater_ims_base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I663bd2826e43ce888990b012df27ca94e2d49a8d Signed-off-by: Cédric Ollivier (cherry picked from commit 020ac360117ad3dffceef7286b2a4888664f5cf4) --- functest/opnfv_tests/vnf/ims/clearwater_ims_base.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/functest/opnfv_tests/vnf/ims/clearwater_ims_base.py b/functest/opnfv_tests/vnf/ims/clearwater_ims_base.py index 6b54d220a..e01cef7b9 100644 --- a/functest/opnfv_tests/vnf/ims/clearwater_ims_base.py +++ b/functest/opnfv_tests/vnf/ims/clearwater_ims_base.py @@ -80,7 +80,7 @@ class ClearwaterOnBoardingBase(vnf.VnfOnBoarding): i = 30 while req.status_code != 200 and i > 0: try: - number_res = self.create_ellis_number(number_url, cookies) + number_res = self._create_ellis_number(number_url, cookies) break except Exception: # pylint: disable=broad-except if i == 1: @@ -93,12 +93,12 @@ class ClearwaterOnBoardingBase(vnf.VnfOnBoarding): if two_numbers: self.logger.debug('Create 2nd calling number on Ellis') - number_res = self.create_ellis_number(number_url, cookies) + number_res = self._create_ellis_number(number_url, cookies) output_dict['number2'] = number_res return output_dict - def create_ellis_number(self, number_url, cookies): + def _create_ellis_number(self, number_url, cookies): req = requests.post(number_url, cookies=cookies) if req.status_code != 200: @@ -114,6 +114,7 @@ class ClearwaterOnBoardingBase(vnf.VnfOnBoarding): def run_clearwater_live_test(self, dns_ip, public_domain, bono_ip=None, ellis_ip=None, signup_code='secret'): + # pylint: disable=too-many-locals,too-many-arguments self.logger.info('Run Clearwater live test') dns_file = '/etc/resolv.conf' dns_file_bak = '/etc/resolv.conf.bak' @@ -143,11 +144,12 @@ class ClearwaterOnBoardingBase(vnf.VnfOnBoarding): dnsmasq_process.kill() with open(dns_file_bak, 'r') as bak_file: result = bak_file.read() - with open(dns_file, 'w') as f: - f.write(result) + with open(dns_file, 'w') as dfile: + dfile.write(result) + + with open(output_file, 'r') as ofile: + result = ofile.read() - f = open(output_file, 'r') - result = f.read() if result != "": self.logger.debug(result) -- cgit 1.2.3-korg