Protect vs former interface format
[functest.git] / functest / opnfv_tests / sdn / odl / odl.py
index cc56c62..21c879e 100644 (file)
@@ -27,10 +27,10 @@ import sys
 
 import os_client_config
 from six.moves import urllib
+from xtesting.core import robotframework
 
 from functest.utils import config
 from functest.utils import env
-from xtesting.core import robotframework
 
 __author__ = "Cedric Ollivier <cedric.ollivier@orange.com>"
 
@@ -159,8 +159,10 @@ class ODLTests(robotframework.RobotFramework):
             cloud = os_client_config.make_shade()
             neutron_id = cloud.search_services('neutron')[0].id
             endpoint = cloud.search_endpoints(
-                filters={'interface': os.environ.get('OS_INTERFACE', 'public'),
-                         'service_id': neutron_id})[0].url
+                filters={
+                    'interface': os.environ.get(
+                        'OS_INTERFACE', 'public').replace('URL', ''),
+                    'service_id': neutron_id})[0].url
             kwargs = {'neutronurl': endpoint}
             kwargs['odlip'] = env.get('SDN_CONTROLLER_IP')
             kwargs['odlwebport'] = '8080'
@@ -189,9 +191,8 @@ class ODLTests(robotframework.RobotFramework):
                 kwargs['odlrestconfport'] = '8087'
             assert kwargs['odlip']
         except KeyError as ex:
-            self.__logger.error("Cannot run ODL testcases. "
-                                "Please check env var: "
-                                "%s", str(ex))
+            self.__logger.error(
+                "Cannot run ODL testcases. Please check env var: %s", str(ex))
             return self.EX_RUN_ERROR
         except Exception:  # pylint: disable=broad-except
             self.__logger.exception("Cannot run ODL testcases.")