diff options
author | Alexander Shorin <kxepal@apache.org> | 2014-11-15 18:51:38 +0300 |
---|---|---|
committer | Alexander Shorin <kxepal@apache.org> | 2014-11-16 00:51:15 +0300 |
commit | 9ad3f9bdbbbe23fe56f888b6779863c7c7bb53db (patch) | |
tree | 4f3455a8739b72984db4560bf7a866c558599b3a | |
parent | 806979e0e04e2748dab6aec31cc68254644d3757 (diff) | |
download | couchdb-9ad3f9bdbbbe23fe56f888b6779863c7c7bb53db.tar.gz |
Handle couchjs restart command correctly
-rwxr-xr-x | dev/run | 9 | ||||
-rwxr-xr-x | test/javascript/run | 3 |
2 files changed, 9 insertions, 3 deletions
@@ -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) |