diff options
Diffstat (limited to 'functest/opnfv_tests/sdn/odl')
-rw-r--r-- | functest/opnfv_tests/sdn/odl/odl.py | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/functest/opnfv_tests/sdn/odl/odl.py b/functest/opnfv_tests/sdn/odl/odl.py index b54f0f54b..72c38ce2c 100644 --- a/functest/opnfv_tests/sdn/odl/odl.py +++ b/functest/opnfv_tests/sdn/odl/odl.py @@ -49,7 +49,7 @@ class ODLTests(robotframework.RobotFramework): __logger = logging.getLogger(__name__) def __init__(self, **kwargs): - super(ODLTests, self).__init__(**kwargs) + super().__init__(**kwargs) self.res_dir = os.path.join( getattr(config.CONF, 'dir_results'), 'odl') self.xml_file = os.path.join(self.res_dir, 'output.xml') @@ -66,10 +66,10 @@ class ODLTests(robotframework.RobotFramework): try: for line in fileinput.input(cls.odl_variables_file, inplace=True): - print(re.sub("@{AUTH}.*", - "@{{AUTH}} {} {}".format( - odlusername, odlpassword), - line.rstrip())) + print(re.sub( + "@{AUTH}.*", + f"@{{AUTH}} {odlusername} {odlpassword}", + line.rstrip())) return True except Exception: # pylint: disable=broad-except cls.__logger.exception("Cannot set ODL creds:") @@ -111,9 +111,8 @@ class ODLTests(robotframework.RobotFramework): odlusername = kwargs['odlusername'] odlpassword = kwargs['odlpassword'] osauthurl = kwargs['osauthurl'] - keystoneurl = "{}://{}".format( - urllib.parse.urlparse(osauthurl).scheme, - urllib.parse.urlparse(osauthurl).netloc) + keystoneurl = (f"{urllib.parse.urlparse(osauthurl).scheme}://" + f"{urllib.parse.urlparse(osauthurl).netloc}") variable = ['KEYSTONEURL:' + keystoneurl, 'NEUTRONURL:' + kwargs['neutronurl'], 'OS_AUTH_URL:"' + osauthurl + '"', @@ -135,7 +134,7 @@ class ODLTests(robotframework.RobotFramework): else: if not self.set_robotframework_vars(odlusername, odlpassword): return self.EX_RUN_ERROR - return super(ODLTests, self).run(variable=variable, suites=suites) + return super().run(variable=variable, suites=suites) def run(self, **kwargs): """Run suites in OPNFV environment |