Return-Path: X-Original-To: apmail-couchdb-commits-archive@www.apache.org Delivered-To: apmail-couchdb-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E2025118B2 for ; Wed, 10 Sep 2014 09:38:10 +0000 (UTC) Received: (qmail 57001 invoked by uid 500); 10 Sep 2014 09:38:01 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 56942 invoked by uid 500); 10 Sep 2014 09:38:01 -0000 Mailing-List: contact commits-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list commits@couchdb.apache.org Received: (qmail 56933 invoked by uid 99); 10 Sep 2014 09:38:01 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Sep 2014 09:38:01 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 288BD9C0B; Wed, 10 Sep 2014 09:38:01 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: mikewallace@apache.org To: commits@couchdb.apache.org Message-Id: <219e8f5644f94ff4957050d1c8976762@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: couchdb commit: updated refs/heads/2324-fix-n-in-dev-run to e7bdfa8 Date: Wed, 10 Sep 2014 09:38:01 +0000 (UTC) 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 Authored: Wed Sep 10 10:06:01 2014 +0100 Committer: Mike Wallace 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)