Code Review
/
integration
/
test.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Migrate Get Requests invocations(libraries)
[integration/test.git]
/
tools
/
clustering
/
cluster-deployer
/
remote_host.py
diff --git
a/tools/clustering/cluster-deployer/remote_host.py
b/tools/clustering/cluster-deployer/remote_host.py
index cb5d1818dcc2dc8fd0e252d7158e3447270e31e5..1a5a9aaaad45e2cc5561ca5f3c6dac1714683504 100644
(file)
--- a/
tools/clustering/cluster-deployer/remote_host.py
+++ b/
tools/clustering/cluster-deployer/remote_host.py
@@
-23,31
+23,36
@@
class RemoteHost:
self.lib.close_connection()
def exec_cmd(self, command):
self.lib.close_connection()
def exec_cmd(self, command):
- print
"Executing command " + command + " on host " + self.host
+ print
("Executing command %s on host %s" % (command, self.host))
rc = self.lib.execute_command(command, return_rc=True)
if rc[1] != 0:
rc = self.lib.execute_command(command, return_rc=True)
if rc[1] != 0:
- raise Exception('remote command failed [{0}] with exit code {1}.'
- 'For linux-based vms, Please make sure requiretty is disabled in the /etc/sudoers file'
- .format(command, rc))
+ raise Exception(
+ "remote command failed [{0}] with exit code {1}."
+ "For linux-based vms, Please make sure requiretty is disabled in the /etc/sudoers file".format(
+ command, rc
+ )
+ )
def mkdir(self, dir_name):
self.exec_cmd("mkdir -p " + dir_name)
def copy_file(self, src, dest):
if src is None:
def mkdir(self, dir_name):
self.exec_cmd("mkdir -p " + dir_name)
def copy_file(self, src, dest):
if src is None:
- print
"src is None not copy anything to " + dest
+ print
("src is None not copy anything to ", dest)
return
if os.path.exists(src) is False:
return
if os.path.exists(src) is False:
- print
"Src file " + src + " was not found"
+ print
("Src file " + src + " was not found")
return
return
- print
"Copying " + src + " to " + dest + " on " + self.host
+ print
("Copying %s to %s on %s" % (src, dest, self.host))
self.lib.put_file(src, dest)
def kill_controller(self):
self.lib.put_file(src, dest)
def kill_controller(self):
- self.exec_cmd("sudo ps axf | grep karaf | grep -v grep "
- "| awk '{print \"kill -9 \" $1}' | sudo sh")
+ self.exec_cmd(
+ "sudo ps axf | grep karaf | grep -v grep "
+ "| awk '{print \"kill -9 \" $1}' | sudo sh"
+ )
def start_controller(self, dir_name):
self.exec_cmd(dir_name + "/odl/bin/start")
def start_controller(self, dir_name):
self.exec_cmd(dir_name + "/odl/bin/start")