diff options
| author | Simon MacMullen <simon@rabbitmq.com> | 2011-11-24 16:51:28 +0000 |
|---|---|---|
| committer | Simon MacMullen <simon@rabbitmq.com> | 2011-11-24 16:51:28 +0000 |
| commit | 218a9c73b6de4a7b3eeec84d17e3d1a44c4bea2d (patch) | |
| tree | a6734bba9ed877a3eaeeed42bb7bed58287a0eef /src | |
| parent | c99557f6fbe00eb6c29832b169bee68813f24a77 (diff) | |
| download | rabbitmq-server-git-218a9c73b6de4a7b3eeec84d17e3d1a44c4bea2d.tar.gz | |
Basic rabbitmqctl eval, with let-it-crash error handling.
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_control.erl | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/rabbit_control.erl b/src/rabbit_control.erl index fa8dd262e1..9d47a78f16 100644 --- a/src/rabbit_control.erl +++ b/src/rabbit_control.erl @@ -368,6 +368,13 @@ action(report, Node, _Args, _Opts, Inform) -> [print_report(Node, Q) || Q <- ?GLOBAL_QUERIES], [print_report(Node, Q, [V]) || Q <- ?VHOST_QUERIES, V <- VHosts], io:format("End of server status report~n"), + ok; + +action(eval, Node, [Expr], _Opts, _Inform) -> + {ok, Scanned, _} = erl_scan:string(Expr), + {ok, Parsed} = erl_parse:parse_exprs(Scanned), + {value, Value, _Bindings} = rpc_call(Node, erl_eval, exprs, [Parsed, []]), + io:format("~p~n", [Value]), ok. %%---------------------------------------------------------------------------- |
