summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoriilyak <iilyak@users.noreply.github.com>2019-09-10 10:29:09 -0700
committerGitHub <noreply@github.com>2019-09-10 10:29:09 -0700
commite746d9027f82bfe394cb95c6b2fad09df43fcca9 (patch)
tree2623f2b751f41b93fdcd1f63d63d7223d67f6663
parent7ada3046f0a4a6d097f26a2b171ec21b6d5ec362 (diff)
parentdd5ac138ecbdee76ff3ba68664f25c2a5cdda7cc (diff)
downloadcouchdb-e746d9027f82bfe394cb95c6b2fad09df43fcca9.tar.gz
Merge pull request #2183 from cloudant/add-extra-arguments-to-beam
Support `--extra_args` parameter in `dev/run`
-rwxr-xr-xdev/run16
1 files changed, 15 insertions, 1 deletions
diff --git a/dev/run b/dev/run
index 10351eb86..9209c1129 100755
--- a/dev/run
+++ b/dev/run
@@ -110,6 +110,11 @@ def setup_logging(ctx):
def setup_argparse():
+ parser = get_args_parser()
+ return parser.parse_args()
+
+
+def get_args_parser():
parser = optparse.OptionParser(description="Runs CouchDB 2.0 dev cluster")
parser.add_option(
"-a",
@@ -200,7 +205,13 @@ def setup_argparse():
action="store_true",
help="Select available ports for nodes automatically",
)
- return parser.parse_args()
+ parser.add_option(
+ "--extra_args",
+ dest="extra_args",
+ default=None,
+ help="Extra arguments to pass to beam process",
+ )
+ return parser
def setup_context(opts, args):
@@ -223,6 +234,7 @@ def setup_context(opts, args):
"haproxy_port": opts.haproxy_port,
"config_overrides": opts.config_overrides,
"no_eval": opts.no_eval,
+ "extra_args": opts.extra_args,
"reset_logs": True,
"procs": [],
"auto_ports": opts.auto_ports,
@@ -578,6 +590,8 @@ def boot_node(ctx, node):
mode = "r+b"
logfname = os.path.join(ctx["devdir"], "logs", "%s.log" % node)
log = open(logfname, mode)
+ if "extra_args" in ctx and ctx["extra_args"]:
+ cmd += ctx["extra_args"].split(" ")
cmd = [toposixpath(x) for x in cmd]
return sp.Popen(cmd, stdin=sp.PIPE, stdout=log, stderr=sp.STDOUT, env=env)