aboutsummaryrefslogtreecommitdiffstats
path: root/functest/opnfv_tests/sdn/odl/odl.py
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2017-05-17 06:06:51 +0200
committerCédric Ollivier <cedric.ollivier@orange.com>2017-05-17 07:24:29 +0200
commitc883810963b208e60b714e2c222b32f20bd6138a (patch)
tree18fbcba71c151538950c41715b5db57c41a24a81 /functest/opnfv_tests/sdn/odl/odl.py
parentb8b2c014b48511486e8cccbcfcaebad843239ac5 (diff)
Add Python3 support to the ODL testcase
It also adds this support to its dependencies. Change-Id: I0534f0c7b0e15a9ee89f522f314cf5200874454c Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
Diffstat (limited to 'functest/opnfv_tests/sdn/odl/odl.py')
-rwxr-xr-xfunctest/opnfv_tests/sdn/odl/odl.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/functest/opnfv_tests/sdn/odl/odl.py b/functest/opnfv_tests/sdn/odl/odl.py
index e50d9c130..6f586b7a0 100755
--- a/functest/opnfv_tests/sdn/odl/odl.py
+++ b/functest/opnfv_tests/sdn/odl/odl.py
@@ -25,12 +25,12 @@ import logging
import os
import re
import sys
-import urlparse
import robot.api
from robot.errors import RobotError
import robot.run
from robot.utils.robottime import timestamp_to_secs
+from six.moves import urllib
from functest.core import testcase
import functest.utils.openstack_utils as op_utils
@@ -87,10 +87,10 @@ class ODLTests(testcase.TestCase):
try:
for line in fileinput.input(odl_variables_files,
inplace=True):
- print re.sub("AUTH = .*",
+ print(re.sub("AUTH = .*",
("AUTH = [u'" + odlusername + "', u'" +
odlpassword + "']"),
- line.rstrip())
+ line.rstrip()))
return True
except Exception as ex: # pylint: disable=broad-except
cls.__logger.error("Cannot set ODL creds: %s", str(ex))
@@ -150,7 +150,7 @@ class ODLTests(testcase.TestCase):
odlusername = kwargs['odlusername']
odlpassword = kwargs['odlpassword']
osauthurl = kwargs['osauthurl']
- keystoneip = urlparse.urlparse(osauthurl).hostname
+ keystoneip = urllib.parse.urlparse(osauthurl).hostname
variables = ['KEYSTONE:' + keystoneip,
'NEUTRON:' + kwargs['neutronip'],
'OS_AUTH_URL:"' + osauthurl + '"',
@@ -218,7 +218,7 @@ class ODLTests(testcase.TestCase):
except KeyError:
pass
neutron_url = op_utils.get_endpoint(service_type='network')
- kwargs = {'neutronip': urlparse.urlparse(neutron_url).hostname}
+ kwargs = {'neutronip': urllib.parse.urlparse(neutron_url).hostname}
kwargs['odlip'] = kwargs['neutronip']
kwargs['odlwebport'] = '8080'
kwargs['odlrestconfport'] = '8181'