From 2a0702ea914a574ffa7c6d6f83a5c606e24ebd0a Mon Sep 17 00:00:00 2001 From: Cédric Ollivier Date: Tue, 7 May 2019 11:02:43 +0200 Subject: Update to Python3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- functest/opnfv_tests/openstack/rally/rally.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'functest/opnfv_tests/openstack/rally') 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() -- cgit 1.2.3-korg