diff options
author | 2018-06-15 17:55:23 +0200 | |
---|---|---|
committer | 2018-06-15 17:57:56 +0200 | |
commit | 020ac360117ad3dffceef7286b2a4888664f5cf4 (patch) | |
tree | 68706c7e07145f329179c8248b7f3f1d24deeb81 /functest | |
parent | 5c8e134c88dc158ad3a151da04485cd57168611c (diff) |
Fix pylint warnings in clearwater_ims_base
Change-Id: I663bd2826e43ce888990b012df27ca94e2d49a8d
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
Diffstat (limited to 'functest')
-rw-r--r-- | functest/opnfv_tests/vnf/ims/clearwater_ims_base.py | 16 |
1 files 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) |