mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2025-02-21 11:33:04 -05:00
tests: remotehost.py use join
Use join instead of for. Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
This commit is contained in:
parent
3b11ad34eb
commit
6a003eb2a6
@ -11,6 +11,8 @@ import threading
|
|||||||
logger = logging.getLogger()
|
logger = logging.getLogger()
|
||||||
|
|
||||||
def execute_thread(command, reply):
|
def execute_thread(command, reply):
|
||||||
|
cmd = ' '.join(command)
|
||||||
|
logger.debug("thread run: " + cmd)
|
||||||
try:
|
try:
|
||||||
status = 0;
|
status = 0;
|
||||||
buf = subprocess.check_output(command, stderr=subprocess.STDOUT)
|
buf = subprocess.check_output(command, stderr=subprocess.STDOUT)
|
||||||
@ -18,9 +20,6 @@ def execute_thread(command, reply):
|
|||||||
status = e.returncode
|
status = e.returncode
|
||||||
buf = e.output
|
buf = e.output
|
||||||
|
|
||||||
cmd = ""
|
|
||||||
for c in command:
|
|
||||||
cmd = cmd + " " + c
|
|
||||||
logger.debug("thread cmd: " + cmd)
|
logger.debug("thread cmd: " + cmd)
|
||||||
logger.debug("thread exit status: " + str(status))
|
logger.debug("thread exit status: " + str(status))
|
||||||
logger.debug("thread exit buf: " + str(buf))
|
logger.debug("thread exit buf: " + str(buf))
|
||||||
@ -55,9 +54,7 @@ class Host():
|
|||||||
return self.local_execute(command)
|
return self.local_execute(command)
|
||||||
|
|
||||||
cmd = ["ssh", self.user + "@" + self.host, ' '.join(command)]
|
cmd = ["ssh", self.user + "@" + self.host, ' '.join(command)]
|
||||||
_cmd = self.name + " execute: "
|
_cmd = self.name + " execute: " + ' '.join(cmd)
|
||||||
for c in cmd:
|
|
||||||
_cmd = _cmd + " " + c
|
|
||||||
logger.debug(_cmd)
|
logger.debug(_cmd)
|
||||||
try:
|
try:
|
||||||
status = 0
|
status = 0
|
||||||
@ -76,9 +73,7 @@ class Host():
|
|||||||
cmd = command
|
cmd = command
|
||||||
else:
|
else:
|
||||||
cmd = ["ssh", self.user + "@" + self.host, ' '.join(command)]
|
cmd = ["ssh", self.user + "@" + self.host, ' '.join(command)]
|
||||||
_cmd = self.name + " execute_run: "
|
_cmd = self.name + " execute_run: " + ' '.join(cmd)
|
||||||
for c in cmd:
|
|
||||||
_cmd = _cmd + " " + c
|
|
||||||
logger.debug(_cmd)
|
logger.debug(_cmd)
|
||||||
t = threading.Thread(target = execute_thread, args=(cmd, res))
|
t = threading.Thread(target = execute_thread, args=(cmd, res))
|
||||||
t.start()
|
t.start()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user