diff options
author | Cédric Ollivier <cedric.ollivier@orange.com> | 2019-09-12 10:22:49 +0200 |
---|---|---|
committer | Cédric Ollivier <cedric.ollivier@orange.com> | 2019-09-14 10:24:17 +0200 |
commit | c1b25e9a487436c75d2f0fd625b95c6c59563e64 (patch) | |
tree | 749df2e322aee5f48ae9e0730939124a3614c38a /functest/opnfv_tests/vnf/ims/clearwater.py | |
parent | fe79a7a341bf99d33853ce49ad5536df5ce10a62 (diff) |
Select python 3.6 as default
It switches to Python3 as default due to new OPNFV iruya release
date (December) which is very closed to Python2 EOL.
Functest Iruya (first release published in April) has supported
both Python2 and Python3.
Change-Id: I4c1294a5361e591fc7a8a88b3d067fc3b39e00c4
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.py | 19 |
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) |