diff options
author | Mike Wallace <mikewallace@apache.org> | 2014-09-10 10:06:01 +0100 |
---|---|---|
committer | Mike Wallace <mikewallace@apache.org> | 2014-09-10 10:34:08 +0100 |
commit | e7bdfa83525d10b289db3c749dfcdb708b82bfc1 (patch) | |
tree | 2528aec2fadf270166cb39f3c9d2b6a4d847d783 | |
parent | 38cc17dea8a945c202b512afe2f0278c4fa8bed8 (diff) | |
download | couchdb-e7bdfa83525d10b289db3c749dfcdb708b82bfc1.tar.gz |
Make N value in dev/run configurable2324-fix-n-in-dev-run
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
-rwxr-xr-x | dev/run | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -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) |