summaryrefslogtreecommitdiffstats
path: root/functest/opnfv_tests/openstack/tempest/conf_utils.py
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2018-06-14 20:51:41 +0200
committerCédric Ollivier <cedric.ollivier@orange.com>2018-07-27 14:31:36 +0200
commita321d59c36f368a3a1aeefaa09c9e66b1e8c13c0 (patch)
treeb186e9a1d417d4c73ee135aa4a5688a4689f73d2 /functest/opnfv_tests/openstack/tempest/conf_utils.py
parentcbf303ec56a1e59d87cf15ba98c6626fa6a03c03 (diff)
Add py3 support in tempest and rally
Change-Id: I009d38a0db409ab4ec641cba9173ab2386d0ce2a Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com> (cherry picked from commit 09d6e6feef33fa47bca440a096894b851b1ebca5)
Diffstat (limited to 'functest/opnfv_tests/openstack/tempest/conf_utils.py')
-rw-r--r--functest/opnfv_tests/openstack/tempest/conf_utils.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/functest/opnfv_tests/openstack/tempest/conf_utils.py b/functest/opnfv_tests/openstack/tempest/conf_utils.py
index 327333e0d..88ad3b2d9 100644
--- a/functest/opnfv_tests/openstack/tempest/conf_utils.py
+++ b/functest/opnfv_tests/openstack/tempest/conf_utils.py
@@ -10,13 +10,15 @@
"""Tempest configuration utilities."""
-import ConfigParser
+from __future__ import print_function
+
import logging
import fileinput
import os
import subprocess
import pkg_resources
+from six.moves import configparser
import yaml
from functest.utils import config
@@ -54,9 +56,9 @@ def create_rally_deployment():
rally_patch_conf = pfile.read()
for line in fileinput.input(RALLY_CONF_PATH, inplace=1):
- print line,
+ print(line, end=' ')
if "cirros|testvm" in line:
- print rally_patch_conf
+ print(rally_patch_conf)
LOGGER.info("Creating Rally environment...")
@@ -189,7 +191,7 @@ def configure_tempest_update_params(
Add/update needed parameters into tempest.conf file
"""
LOGGER.debug("Updating selected tempest.conf parameters...")
- rconfig = ConfigParser.RawConfigParser()
+ rconfig = configparser.RawConfigParser()
rconfig.read(tempest_conf_file)
rconfig.set('compute', 'fixed_network_name', network_name)
rconfig.set('compute', 'volume_device_name', env.get('VOLUME_DEVICE_NAME'))