From 423db209c5efe182fd1b82c2eec0df7c38dc7c8d Mon Sep 17 00:00:00 2001 From: Cédric Ollivier Date: Mon, 25 Apr 2016 09:27:21 +0200 Subject: Remove backslashs for line continuation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit JIRA: FUNCTEST-213 Change-Id: Ia50521cf8fcf60a847aa44fe0ea59b6e64830e92 Signed-off-by: Cédric Ollivier --- testcases/Controllers/ONOS/Teston/CI/adapters/client.py | 4 ++-- .../Controllers/ONOS/Teston/CI/adapters/environment.py | 16 ++++++++-------- .../Controllers/ONOS/Teston/CI/adapters/foundation.py | 4 ++-- testcases/Controllers/ONOS/Teston/CI/onosfunctest.py | 8 ++++---- 4 files changed, 16 insertions(+), 16 deletions(-) (limited to 'testcases/Controllers/ONOS/Teston/CI') diff --git a/testcases/Controllers/ONOS/Teston/CI/adapters/client.py b/testcases/Controllers/ONOS/Teston/CI/adapters/client.py index 15bb73c91..77de092e4 100644 --- a/testcases/Controllers/ONOS/Teston/CI/adapters/client.py +++ b/testcases/Controllers/ONOS/Teston/CI/adapters/client.py @@ -36,8 +36,8 @@ class client(environment): self.ChangeTestCasePara(testname, self.masterusername, self.masterpassword) runhandle = handle - runtest = self.home + "/OnosSystemTest/TestON/bin/cli.py run " + \ - testname + runtest = (self.home + "/OnosSystemTest/TestON/bin/cli.py run " + + testname) runhandle.sendline(runtest) circletime = 0 lastshowscreeninfo = '' diff --git a/testcases/Controllers/ONOS/Teston/CI/adapters/environment.py b/testcases/Controllers/ONOS/Teston/CI/adapters/environment.py index 4fc636aba..49f7f9632 100644 --- a/testcases/Controllers/ONOS/Teston/CI/adapters/environment.py +++ b/testcases/Controllers/ONOS/Teston/CI/adapters/environment.py @@ -136,8 +136,8 @@ class environment(connection): print "try to connect " + str(host) result = self.CheckSshNoPasswd(host) if not result: - print "ssh lgin failed,try to copy master publickey" + \ - "to agent " + str(host) + print ("ssh lgin failed,try to copy master publickey" + + "to agent " + str(host)) self.CopyPublicKey(host) self.OnosPushKeys(handle, "onos-push-keys " + self.OCT, masterpass) self.OnosPushKeys(handle, "onos-push-keys " + self.OC1, agentpass) @@ -201,18 +201,18 @@ class environment(connection): filepath = '/root/' else: filepath = '/home/' + self.masterusername + '/' - filepath = filepath + "OnosSystemTest/TestON/tests/" \ - + testcase + "/" + testcase + ".topo" + filepath = (filepath + "OnosSystemTest/TestON/tests/" + + testcase + "/" + testcase + ".topo") line = open(filepath, 'r').readlines() lenall = len(line) - 1 for i in range(lenall - 2): if("localhost" in line[i]) or ("OCT" in line[i]): line[i + 1] = re.sub(">\w+", ">" + user, line[i + 1]) line[i + 2] = re.sub(">\w+", ">" + password, line[i + 2]) - if "OC1" in line[i] or "OC2" in line[i] or "OC3" in line[i] or \ - "OCN" in line[i] or "OCN2" in line[i]: - line[i + 1] = re.sub(">\w+", ">root", line[i + 1]) - line[i + 2] = re.sub(">\w+", ">root", line[i + 2]) + if ("OC1" in line[i] or "OC2" in line[i] or "OC3" in line[i] or + "OCN" in line[i] or "OCN2" in line[i]): + line[i + 1] = re.sub(">\w+", ">root", line[i + 1]) + line[i + 2] = re.sub(">\w+", ">root", line[i + 2]) NewFile = open(filepath, 'w') NewFile.writelines(line) NewFile.close diff --git a/testcases/Controllers/ONOS/Teston/CI/adapters/foundation.py b/testcases/Controllers/ONOS/Teston/CI/adapters/foundation.py index a4591ac72..d4a145566 100644 --- a/testcases/Controllers/ONOS/Teston/CI/adapters/foundation.py +++ b/testcases/Controllers/ONOS/Teston/CI/adapters/foundation.py @@ -67,8 +67,8 @@ class foundation: get("onoscli_username")) self.agentpassword = str(functest_yaml.get("ONOS").get("general"). get("onoscli_password")) - self.runtimeout = functest_yaml.get("ONOS").\ - get("general").get("runtimeout") + self.runtimeout = functest_yaml.get("ONOS").get("general").get( + "runtimeout") self.OCT = str(functest_yaml.get("ONOS").get("environment").get("OCT")) self.OC1 = str(functest_yaml.get("ONOS").get("environment").get("OC1")) self.OC2 = str(functest_yaml.get("ONOS").get("environment").get("OC2")) diff --git a/testcases/Controllers/ONOS/Teston/CI/onosfunctest.py b/testcases/Controllers/ONOS/Teston/CI/onosfunctest.py index 8186e7da6..f6b7f61c7 100644 --- a/testcases/Controllers/ONOS/Teston/CI/onosfunctest.py +++ b/testcases/Controllers/ONOS/Teston/CI/onosfunctest.py @@ -47,10 +47,10 @@ f.close() # onos parameters TEST_DB = functest_yaml.get("results").get("test_db_url") -ONOS_REPO_PATH = functest_yaml.get("general").\ - get("directories").get("dir_repos") -ONOS_CONF_DIR = functest_yaml.get("general").\ - get("directories").get("dir_functest_conf") +ONOS_REPO_PATH = functest_yaml.get("general").get("directories").get( + "dir_repos") +ONOS_CONF_DIR = functest_yaml.get("general").get("directories").get( + "dir_functest_conf") REPO_PATH = ONOS_REPO_PATH + '/functest/' if not os.path.exists(REPO_PATH): logger.error("Functest repository directory not found '%s'" % REPO_PATH) -- cgit 1.2.3-korg