Commit 57ac9dd1 authored by Timothy Stack's avatar Timothy Stack
Browse files

Pass -o BatchMode=yes to ssh.

parent 0111d63f
...@@ -881,7 +881,7 @@ def rsync(host, base, dlpath, paths = ["/"], port = None): ...@@ -881,7 +881,7 @@ def rsync(host, base, dlpath, paths = ["/"], port = None):
if VERBOSITY > VERBOSITY_HUMAN: if VERBOSITY > VERBOSITY_HUMAN:
cmd.append("-v") cmd.append("-v")
pass pass
ssh_args = ("ssh -o StrictHostKeyChecking=no " ssh_args = ("ssh -o BatchMode=yes -o StrictHostKeyChecking=no "
+ "-o UserKnownHostsFile=" + "-o UserKnownHostsFile="
+ os.path.join(HOME, ".ssh", "emulab_known_hosts")) + os.path.join(HOME, ".ssh", "emulab_known_hosts"))
if port: if port:
...@@ -900,6 +900,8 @@ def rsync(host, base, dlpath, paths = ["/"], port = None): ...@@ -900,6 +900,8 @@ def rsync(host, base, dlpath, paths = ["/"], port = None):
# Parent # Parent
pass pass
else: else:
os.close(0)
fd = os.open("/dev/null", os.O_RDONLY)
os.execve(RSYNC, cmd, os.environ) os.execve(RSYNC, cmd, os.environ)
os._exit(127) os._exit(127)
pass pass
...@@ -908,19 +910,20 @@ def rsync(host, base, dlpath, paths = ["/"], port = None): ...@@ -908,19 +910,20 @@ def rsync(host, base, dlpath, paths = ["/"], port = None):
return retval return retval
def rmstar(host, *args): def rmstar(host, port, *args):
global HOME, DEBUG global HOME, DEBUG
retval = 0 retval = 0
for path in args: for path in args:
cmd = ["/usr/bin/ssh", cmd = ["/usr/bin/ssh",
"-o", "BatchMode=yes",
"-o", "StrictHostKeyChecking=no", "-o", "StrictHostKeyChecking=no",
"-o", ("UserKnownHostsFile=" + "-o", ("UserKnownHostsFile=" +
os.path.join(HOME, ".ssh", "emulab_known_hosts")), os.path.join(HOME, ".ssh", "emulab_known_hosts"))]
host, if port:
"rm", cmd.extend([ "-p", str(port) ])
"-rf", pass
path] cmd.extend([ host, "rm", "-rf", path ])
if DEBUG: if DEBUG:
print `cmd` print `cmd`
retval = -1 retval = -1
...@@ -1110,7 +1113,8 @@ def do_sync(args, mode="sync", must_be_active=1): ...@@ -1110,7 +1113,8 @@ def do_sync(args, mode="sync", must_be_active=1):
port = sd.get("port", None)) port = sd.get("port", None))
pass pass
elif mode == "clean": elif mode == "clean":
pid = rmstar(phost, "/local/logs/*") pid = rmstar(phost, sd.get("port", None),
"/local/logs/*")
pass pass
else: else:
assert 0 assert 0
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment