summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2018-06-15 17:55:23 +0200
committerCédric Ollivier <cedric.ollivier@orange.com>2018-06-18 17:41:59 +0200
commite13e87d9d064c2427208104d3dacc9b8aee95b6e (patch)
tree778adac0486b788102a9ba8793eb0fdea29301b7
parent50049c516d0346a072c69a66f9f5ce173718bc92 (diff)
Fix pylint warnings in clearwater_ims_base
Change-Id: I663bd2826e43ce888990b012df27ca94e2d49a8d Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com> (cherry picked from commit 020ac360117ad3dffceef7286b2a4888664f5cf4)
-rw-r--r--functest/opnfv_tests/vnf/ims/clearwater_ims_base.py16
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)