summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2010-04-01 22:29:14 -0400
committerEric S. Raymond <esr@thyrsus.com>2010-04-01 22:29:14 -0400
commitcee75fdd62580ebda6b723fed437f9dc27a9ba23 (patch)
treec7a84c31b15df0a6c721ada961e8d3aaf8833718
parent0f014b67a04e448d7efc3ad2aed02672bce8c516 (diff)
downloadgpsd-cee75fdd62580ebda6b723fed437f9dc27a9ba23.tar.gz
Key-installation mode finally works.
-rwxr-xr-xdevtools/flocktest19
1 files changed, 11 insertions, 8 deletions
diff --git a/devtools/flocktest b/devtools/flocktest
index 237417c2..dbd113da 100755
--- a/devtools/flocktest
+++ b/devtools/flocktest
@@ -58,7 +58,7 @@ class TestSite:
self.me = self.config["login"] + "@" + self.fqdn
def error(self, msg):
"Report an error while executing a remote command."
- sys.stderr("%s: %s\n" % (site.fqdn, msg))
+ sys.stderr.write("%s: %s\n" % (self.fqdn, msg))
def update_remote(self, filename):
"Copy a specified file to the remote home."
command = "scp %s %s:~" % (filename, self.me)
@@ -72,9 +72,11 @@ class TestSite:
return status
def do_remote(self, command, background=True):
"Execute a command on a specified remote host."
- command = "( ssh %s '%s' )" % (self.me, command)
if background:
- command += " &"
+ suffix = " &"
+ else:
+ suffix = ""
+ command = "ssh %s '%s%s'" % (self.me, command, suffix)
if self.verbose:
print command
status = 0
@@ -85,7 +87,7 @@ class TestSite:
return status
def do_append(self, filename, string):
"Append a line to a specified remote file."
- self.do_remote("echo '%s' >>%s" % (string.strip(), filename),
+ self.do_remote("echo \"%s\" >>%s" % (string.strip(), filename),
background=False)
class TestFlock:
@@ -166,6 +168,11 @@ if __name__ == '__main__':
except IOError:
pass
+ if exclusions:
+ flock.exclude(exclusions)
+ elif 'exclude' in controls:
+ flock.exclude(controls.get('exclude'))
+
if copymode:
flock.update_remote("flockdriver")
elif key:
@@ -189,10 +196,6 @@ if __name__ == '__main__':
if not subdir:
print "flocktest: you don't exist, go away!"
sys.exit(1)
- if exclusions:
- flock.exclude(exclusions)
- elif 'exclude' in controls:
- flock.exclude(controls.get('exclude'))
print "Testing at", flock.listdump()
command = "./flockdriver -d %s -m %s" % (subdir, mailto)
if verbose > 1: