couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject [08/12] couchdb commit: updated refs/heads/1843-feature-bigcouch to 152a21a
Date Thu, 06 Feb 2014 22:12:22 GMT
Remove reliance on the curl command in dev/run


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/089f3adc
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/089f3adc
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/089f3adc

Branch: refs/heads/1843-feature-bigcouch
Commit: 089f3adc62d1a68eb10e6dfd26c707fe264bae71
Parents: 49cb551
Author: Paul J. Davis <paul.joseph.davis@gmail.com>
Authored: Thu Feb 6 16:08:05 2014 -0600
Committer: Paul J. Davis <paul.joseph.davis@gmail.com>
Committed: Thu Feb 6 16:08:05 2014 -0600

----------------------------------------------------------------------
 dev/run | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/089f3adc/dev/run
----------------------------------------------------------------------
diff --git a/dev/run b/dev/run
index aa3d313..deb2c3a 100755
--- a/dev/run
+++ b/dev/run
@@ -15,6 +15,7 @@
 import atexit
 import contextlib as ctx
 import glob
+import httplib
 import optparse as op
 import os
 import re
@@ -163,11 +164,16 @@ def boot_node(node):
             env=env)
 
 
-def connect_nodes(backdoor):
-    for i in range(1,4):
-        cmd = "curl -s %snodes/node%s@127.0.0.1 -X PUT -d '{}'"
-        cmd = cmd % (backdoor, i)
-        sp.check_call(cmd, shell=True)
+def connect_nodes(host, port):
+    global N
+    for i in range(1, N+1):
+        body = "{}"
+        conn = httplib.HTTPConnection(host, port)
+        conn.request("PUT", "/nodes/node%d@127.0.0.1" % i, body)
+        resp = conn.getresponse()
+        if resp.status not in (200, 201, 202, 409):
+            print resp.reason
+            exit(1)
 
 
 def kill_processes():
@@ -227,7 +233,7 @@ def main():
     atexit.register(kill_processes)
 
     boot_nodes()
-    connect_nodes("http://127.0.0.1:15986/")
+    connect_nodes("127.0.0.1", 15986)
 
     if len(args):
         run_command(" ".join(args))


Mime
View raw message