refactor(bin/emax): delete cold_eval
This commit is contained in:
parent
cca3a4414f
commit
01ce32094c
|
@ -89,7 +89,7 @@ roots(high) ->
|
||||||
sc(map("name", ref("zone")),
|
sc(map("name", ref("zone")),
|
||||||
#{ desc => "A zone is a set of configs grouped by the zone <code>name</code>. <br>"
|
#{ desc => "A zone is a set of configs grouped by the zone <code>name</code>. <br>"
|
||||||
"For flexible configuration mapping, the <code>name</code> "
|
"For flexible configuration mapping, the <code>name</code> "
|
||||||
"can be set to a listener's <code>zone</code> config . <br>"
|
"can be set to a listener's <code>zone</code> config.<br>"
|
||||||
"NOTE: A builtin zone named <code>default</code> is auto created "
|
"NOTE: A builtin zone named <code>default</code> is auto created "
|
||||||
"and can not be deleted."
|
"and can not be deleted."
|
||||||
})}
|
})}
|
||||||
|
|
23
bin/emqx
23
bin/emqx
|
@ -114,7 +114,7 @@ relx_usage() {
|
||||||
echo " don't make it permanent"
|
echo " don't make it permanent"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Usage: $REL_NAME {start|start_boot <file>|ertspath|foreground|stop|pid|ping|console|console_clean|console_boot <file>|attach|remote_console|upgrade|downgrade|install|uninstall|versions|escript|ctl|rpc|rpcterms|eval|cold_eval|root_dir}"
|
echo "Usage: $REL_NAME {start|start_boot <file>|ertspath|foreground|stop|pid|ping|console|console_clean|console_boot <file>|attach|remote_console|upgrade|downgrade|install|uninstall|versions|escript|ctl|rpc|rpcterms|eval|root_dir}"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
@ -138,7 +138,6 @@ check_user() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# Make sure the user running this script is the owner and/or su to that user
|
# Make sure the user running this script is the owner and/or su to that user
|
||||||
check_user "$@"
|
check_user "$@"
|
||||||
ES=$?
|
ES=$?
|
||||||
|
@ -355,16 +354,6 @@ case "$1" in
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
IS_NO_CONNECTION_COMMAND='no'
|
|
||||||
case "$1" in
|
|
||||||
cold_eval)
|
|
||||||
IS_NO_CONNECTION_COMMAND='yes'
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
|
|
||||||
## Possible ways to configure emqx node name:
|
## Possible ways to configure emqx node name:
|
||||||
## 1. configure node.name in emqx.conf
|
## 1. configure node.name in emqx.conf
|
||||||
## 2. override with environment variable EMQX_NODE_NAME
|
## 2. override with environment variable EMQX_NODE_NAME
|
||||||
|
@ -375,9 +364,6 @@ if [ -z "$NAME" ]; then
|
||||||
if [ "$IS_BOOT_COMMAND" = 'yes' ]; then
|
if [ "$IS_BOOT_COMMAND" = 'yes' ]; then
|
||||||
# for boot commands, inspect emqx.conf for node name
|
# for boot commands, inspect emqx.conf for node name
|
||||||
NAME="$(call_hocon -s $SCHEMA_MOD -c "$RUNNER_ETC_DIR"/emqx.conf get node.name | tr -d \")"
|
NAME="$(call_hocon -s $SCHEMA_MOD -c "$RUNNER_ETC_DIR"/emqx.conf get node.name | tr -d \")"
|
||||||
elif [ "$IS_NO_CONNECTION_COMMAND" = 'yes' ]; then
|
|
||||||
# this command requires no connection to the target beam node, do nothing
|
|
||||||
:
|
|
||||||
else
|
else
|
||||||
# for non-boot commands, inspect vm.<time>.args for node name
|
# for non-boot commands, inspect vm.<time>.args for node name
|
||||||
# shellcheck disable=SC2012,SC2086
|
# shellcheck disable=SC2012,SC2086
|
||||||
|
@ -405,9 +391,6 @@ COOKIE="${EMQX_NODE_COOKIE:-}"
|
||||||
if [ -z "$COOKIE" ]; then
|
if [ -z "$COOKIE" ]; then
|
||||||
if [ "$IS_BOOT_COMMAND" = 'yes' ]; then
|
if [ "$IS_BOOT_COMMAND" = 'yes' ]; then
|
||||||
COOKIE="$(call_hocon -s $SCHEMA_MOD -c "$RUNNER_ETC_DIR"/emqx.conf get node.cookie | tr -d \")"
|
COOKIE="$(call_hocon -s $SCHEMA_MOD -c "$RUNNER_ETC_DIR"/emqx.conf get node.cookie | tr -d \")"
|
||||||
elif [ "$IS_NO_CONNECTION_COMMAND" = 'yes' ]; then
|
|
||||||
# this command requires no connection to the target beam node, do nothing
|
|
||||||
COOKIE="whatever"
|
|
||||||
else
|
else
|
||||||
# shellcheck disable=SC2012,SC2086
|
# shellcheck disable=SC2012,SC2086
|
||||||
LATEST_VM_ARGS="$(ls -t $CONFIGS_DIR/vm.*.args | head -1)"
|
LATEST_VM_ARGS="$(ls -t $CONFIGS_DIR/vm.*.args | head -1)"
|
||||||
|
@ -714,10 +697,6 @@ case "$1" in
|
||||||
shift
|
shift
|
||||||
relx_nodetool "eval" "$@"
|
relx_nodetool "eval" "$@"
|
||||||
;;
|
;;
|
||||||
cold_eval)
|
|
||||||
shift;
|
|
||||||
"$ERTS_DIR/bin/escript" "$ROOTDIR/bin/nodetool" cold_eval "$@"
|
|
||||||
;;
|
|
||||||
*)
|
*)
|
||||||
relx_usage "$1"
|
relx_usage "$1"
|
||||||
exit 1
|
exit 1
|
||||||
|
|
12
bin/nodetool
12
bin/nodetool
|
@ -24,8 +24,6 @@ main(Args) ->
|
||||||
["hocon" | Rest] ->
|
["hocon" | Rest] ->
|
||||||
%% forward the call to hocon_cli
|
%% forward the call to hocon_cli
|
||||||
hocon_cli:main(Rest);
|
hocon_cli:main(Rest);
|
||||||
["cold_eval" | Rest] ->
|
|
||||||
code_eval(Rest);
|
|
||||||
_ ->
|
_ ->
|
||||||
do(Args)
|
do(Args)
|
||||||
end.
|
end.
|
||||||
|
@ -134,16 +132,6 @@ do(Args) ->
|
||||||
end,
|
end,
|
||||||
net_kernel:stop().
|
net_kernel:stop().
|
||||||
|
|
||||||
code_eval(Args) ->
|
|
||||||
Parsed = parse_eval_args(Args),
|
|
||||||
case erl_eval:exprs(Parsed, []) of
|
|
||||||
{value, Value, _} ->
|
|
||||||
io:format ("~p~n", [Value]);
|
|
||||||
Other ->
|
|
||||||
io:format("cold_eval_failed_with: ~p~n", [Other]),
|
|
||||||
halt(1)
|
|
||||||
end.
|
|
||||||
|
|
||||||
parse_eval_args(Args) ->
|
parse_eval_args(Args) ->
|
||||||
% shells may process args into more than one, and end up stripping
|
% shells may process args into more than one, and end up stripping
|
||||||
% spaces, so this converts all of that to a single string to parse
|
% spaces, so this converts all of that to a single string to parse
|
||||||
|
|
Loading…
Reference in New Issue