summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Shorin <kxepal@apache.org>2014-11-15 18:51:38 +0300
committerAlexander Shorin <kxepal@apache.org>2014-11-16 00:51:15 +0300
commit9ad3f9bdbbbe23fe56f888b6779863c7c7bb53db (patch)
tree4f3455a8739b72984db4560bf7a866c558599b3a
parent806979e0e04e2748dab6aec31cc68254644d3757 (diff)
downloadcouchdb-9ad3f9bdbbbe23fe56f888b6779863c7c7bb53db.tar.gz
Handle couchjs restart command correctly
-rwxr-xr-xdev/run9
-rwxr-xr-xtest/javascript/run3
2 files changed, 9 insertions, 3 deletions
diff --git a/dev/run b/dev/run
index d25c7c666..3f98bf38a 100755
--- a/dev/run
+++ b/dev/run
@@ -66,7 +66,7 @@ def main():
ctx = setup()
startup(ctx)
if ctx['cmd']:
- run_command(ctx['cmd'])
+ run_command(ctx, ctx['cmd'])
else:
join(ctx)
@@ -303,7 +303,7 @@ def join(ctx):
@log('Exec command {cmd}')
-def run_command(cmd):
+def run_command(ctx, cmd):
p = sp.Popen(cmd, shell=True, stdout=sp.PIPE, stderr=sys.stderr)
while True:
line = p.stdout.readline()
@@ -314,6 +314,11 @@ def run_command(cmd):
exit(p.returncode)
+def reboot_nodes(ctx):
+ kill_processes(ctx)
+ boot_nodes(ctx)
+
+
if __name__ == "__main__":
try:
main()
diff --git a/test/javascript/run b/test/javascript/run
index 2b6b382c2..ab145b108 100755
--- a/test/javascript/run
+++ b/test/javascript/run
@@ -82,8 +82,9 @@ def run_couchjs(test, fmt):
line = p.stdout.readline()
if not line:
break
+ line = line.decode()
if line.strip() == "restart":
- sys.stdout.write("reboot_nodes()" + os.linesep)
+ sys.stdout.write("reboot_nodes(ctx)" + os.linesep)
sys.stdout.flush()
else:
sys.stderr.write(line)