aboutsummaryrefslogtreecommitdiffstats
path: root/functest/opnfv_tests/openstack/rally
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2019-05-07 11:02:43 +0200
committerCédric Ollivier <cedric.ollivier@orange.com>2019-05-13 20:10:21 +0200
commit2a0702ea914a574ffa7c6d6f83a5c606e24ebd0a (patch)
treea6f07cda495c2c1631b3366d0d95adee5cf30ef7 /functest/opnfv_tests/openstack/rally
parent0619955a7998868c437a462c9ece3eb1ea7a5277 (diff)
Update to Python3
Functest containers leverage on Python3 instead of python2. https://mail.python.org/pipermail/python-dev/2018-March/152348.html It also updates robotframework librairies to latest release and Vmtp to master ([1] is needed) It patches cloudify rest client to support python3. Vmtp is currently disabled because it currently supports python2 only. [1] https://github.com/openstack/vmtp/commit/a5d062881d91bf4f547d92c6e289bea30feb5d6e#diff-b4ef698db8ca845e5845c4618278f29a Change-Id: I39964a212ec2d4dbf53c9ea7c63f02e0b6a05b48 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
Diffstat (limited to 'functest/opnfv_tests/openstack/rally')
-rw-r--r--functest/opnfv_tests/openstack/rally/rally.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/functest/opnfv_tests/openstack/rally/rally.py b/functest/opnfv_tests/openstack/rally/rally.py
index 25de3cfb6..674c74252 100644
--- a/functest/opnfv_tests/openstack/rally/rally.py
+++ b/functest/opnfv_tests/openstack/rally/rally.py
@@ -166,7 +166,7 @@ class RallyBase(singlevm.VmReady2):
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
deployment_uuid = proc.stdout.readline().rstrip()
- return deployment_uuid
+ return deployment_uuid.decode()
@staticmethod
def create_rally_deployment(environ=None):
@@ -215,7 +215,7 @@ class RallyBase(singlevm.VmReady2):
rconfig.add_section('openstack')
rconfig.set(
'openstack', 'keystone_default_role', env.get("NEW_USER_ROLE"))
- with open(rally_conf, 'wb') as config_file:
+ with open(rally_conf, 'w') as config_file:
rconfig.write(config_file)
@staticmethod
@@ -226,7 +226,7 @@ class RallyBase(singlevm.VmReady2):
rconfig.read(rally_conf)
if rconfig.has_option('openstack', 'keystone_default_role'):
rconfig.remove_option('openstack', 'keystone_default_role')
- with open(rally_conf, 'wb') as config_file:
+ with open(rally_conf, 'w') as config_file:
rconfig.write(config_file)
@staticmethod
@@ -240,7 +240,7 @@ class RallyBase(singlevm.VmReady2):
taskid_re = re.compile('^Task +(.*): started$')
for line in cmd_raw.splitlines(True):
line = line.strip()
- match = taskid_re.match(line)
+ match = taskid_re.match(line.decode())
if match:
return match.group(1)
return None
@@ -657,8 +657,8 @@ class RallyBase(singlevm.VmReady2):
"{}/{}.xml".format(self.results_dir, self.case_name),
export_type="junit-xml")
res = testcase.TestCase.EX_OK
- except Exception as exc: # pylint: disable=broad-except
- LOGGER.error('Error with run: %s', exc)
+ except Exception: # pylint: disable=broad-except
+ LOGGER.exception('Error with run:')
self.result = 0
res = testcase.TestCase.EX_RUN_ERROR
self.stop_time = time.time()