couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikewall...@apache.org
Subject couchdb commit: updated refs/heads/2324-fix-n-in-dev-run to e7bdfa8
Date Wed, 10 Sep 2014 09:38:01 GMT
Repository: couchdb
Updated Branches:
  refs/heads/2324-fix-n-in-dev-run eb6281d73 -> e7bdfa835 (forced update)


Make N value in dev/run configurable

This commit makes N (the number of development nodes spun up)
a command line option. It also fixes a magic number which was
preventing the value of N from changing the number of nodes
spun up.

Closes COUCHDB-2324


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

Branch: refs/heads/2324-fix-n-in-dev-run
Commit: e7bdfa83525d10b289db3c749dfcdb708b82bfc1
Parents: 38cc17d
Author: Mike Wallace <mikewallace@apache.org>
Authored: Wed Sep 10 10:06:01 2014 +0100
Committer: Mike Wallace <mikewallace@apache.org>
Committed: Wed Sep 10 10:34:08 2014 +0100

----------------------------------------------------------------------
 dev/run | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/e7bdfa83/dev/run
----------------------------------------------------------------------
diff --git a/dev/run b/dev/run
index a4f76cb..5bfe86d 100755
--- a/dev/run
+++ b/dev/run
@@ -31,7 +31,7 @@ USAGE = "%prog [options] [command to run...]"
 DEV_PATH = os.path.dirname(os.path.abspath(__file__))
 COUCHDB = os.path.dirname(DEV_PATH)
 
-N = 3
+DEFAULT_N = 3
 PROCESSES = []
 
 
@@ -106,7 +106,7 @@ def write_configs(opts):
     datadir = os.path.join(DEV_PATH, "data")
     if not os.path.exists(datadir):
         os.makedirs(datadir)
-    for i in range(1,4):
+    for i in range(1, N+1):
         node = "node%d" % i
         args = {
             "prefix": COUCHDB,
@@ -234,7 +234,9 @@ def wait_for_procs():
 def options():
     return [
         op.make_option("-a", "--admin", metavar="USER:PASS", default=None,
-            help="Add an admin account to the development cluster")
+            help="Add an admin account to the development cluster"),
+        op.make_option("-n", "--nodes", metavar="N", default=DEFAULT_N,
+            type="int", help="Number of development nodes to be spun up")
     ]
 
 
@@ -242,6 +244,9 @@ def main():
     parser = op.OptionParser(usage=USAGE, option_list=options())
     opts, args = parser.parse_args()
 
+    global N
+    N = opts.nodes
+
     init_log_dir()
     init_beams()
     write_configs(opts)


Mime
View raw message