diff options
author | iilyak <iilyak@users.noreply.github.com> | 2019-09-11 06:45:27 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-11 06:45:27 -0700 |
commit | 5ffdb9191f7769a16ee4514859aeccb76b520c31 (patch) | |
tree | 3e22247439cedf47009d7937bf985bc52862e53e | |
parent | 5c3517ab67d3412abd6187c571385c2e148a79ce (diff) | |
parent | 91dfd3eb791bb398dc02a3afff8b9ea1b9a52421 (diff) | |
download | couchdb-5ffdb9191f7769a16ee4514859aeccb76b520c31.tar.gz |
Merge pull request #2184 from cloudant/add-extra-arguments-to-beam
Support `--extra_args` parameter in `dev/run`
-rwxr-xr-x | dev/run | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -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", @@ -206,7 +211,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): @@ -230,6 +241,7 @@ def setup_context(opts, args): "config_overrides": opts.config_overrides, "erlang_config": opts.erlang_config, "no_eval": opts.no_eval, + "extra_args": opts.extra_args, "reset_logs": True, "procs": [], "auto_ports": opts.auto_ports, @@ -585,6 +597,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) |