aboutsummaryrefslogtreecommitdiffstats
path: root/functest/opnfv_tests/vnf/ims/clearwater.py
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2019-07-26 16:59:14 +0200
committerCédric Ollivier <cedric.ollivier@orange.com>2019-07-27 11:21:29 +0200
commitfa8f32f2d4919ac83a00ea8012a7f0de0de9241c (patch)
treed32993019a93c374af118f1834cb6965076d633b /functest/opnfv_tests/vnf/ims/clearwater.py
parent49858c476ac1e01917cd886594f3be0425d61f59 (diff)
Switch to Python 3.7 and Alpine 3.10
It also allows building docs as doc8 is broken due to latest OpenStack's upper-constraints. pylint is updated to 2.3.1 (lastest py3.7 version) It disables perm as umask is currently false on lf-virtual1. Change-Id: If09d4796d48b7d0591e7926621d3bbf5ca1b6c24 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
Diffstat (limited to 'functest/opnfv_tests/vnf/ims/clearwater.py')
-rw-r--r--functest/opnfv_tests/vnf/ims/clearwater.py19
1 files changed, 8 insertions, 11 deletions
diff --git a/functest/opnfv_tests/vnf/ims/clearwater.py b/functest/opnfv_tests/vnf/ims/clearwater.py
index 64f0428b3..67128b11c 100644
--- a/functest/opnfv_tests/vnf/ims/clearwater.py
+++ b/functest/opnfv_tests/vnf/ims/clearwater.py
@@ -24,7 +24,7 @@ __author__ = ("Valentin Boucher <valentin.boucher@orange.com>, "
"Helen Yao <helanyao@gmail.com>")
-class ClearwaterTesting(object):
+class ClearwaterTesting():
"""vIMS clearwater base usable by several orchestrators"""
def __init__(self, case_name, bono_ip, ellis_ip):
@@ -91,8 +91,7 @@ class ClearwaterTesting(object):
'Account %s is created on Ellis\n%s',
params.get('full_name'), account_res)
return account_res
- else:
- raise Exception("Cannot create ellis account")
+ raise Exception("Cannot create ellis account")
except Exception: # pylint: disable=broad-except
self.logger.info(
"try %s: cannot create ellis account", iloop + 1)
@@ -110,8 +109,7 @@ class ClearwaterTesting(object):
cookies = req.cookies
self.logger.debug('cookies: %s', cookies)
return cookies
- else:
- raise Exception('Failed to get cookies for Ellis')
+ raise Exception('Failed to get cookies for Ellis')
except Exception: # pylint: disable=broad-except
self.logger.info(
"try %s: cannot get cookies for Ellis", iloop + 1)
@@ -128,13 +126,12 @@ class ClearwaterTesting(object):
self.logger.info(
'Calling number is created: %s', number_res)
return number_res
+ if req and req.json():
+ reason = req.json()['reason']
else:
- if req and req.json():
- reason = req.json()['reason']
- else:
- reason = req
- self.logger.info("cannot create a number: %s", reason)
- raise Exception('Failed to create a number')
+ reason = req
+ self.logger.info("cannot create a number: %s", reason)
+ raise Exception('Failed to create a number')
except Exception: # pylint: disable=broad-except
self.logger.info(
"try %s: cannot create a number", iloop + 1)