diff options
| -rw-r--r-- | src/rabbit.erl | 2 | ||||
| -rw-r--r-- | src/rabbit_misc.erl | 6 | ||||
| -rw-r--r-- | src/rabbit_nodes.erl | 8 |
3 files changed, 8 insertions, 8 deletions
diff --git a/src/rabbit.erl b/src/rabbit.erl index 5ada38d270..23e258d3ee 100644 --- a/src/rabbit.erl +++ b/src/rabbit.erl @@ -674,7 +674,7 @@ print_banner() -> {"app descriptor", app_location()}, {"home dir", home_dir()}, {"config file(s)", config_files()}, - {"cookie hash", rabbit_misc:cookie_hash()}, + {"cookie hash", rabbit_nodes:cookie_hash()}, {"log", log_location(kernel)}, {"sasl log", log_location(sasl)}, {"database dir", rabbit_mnesia:dir()}, diff --git a/src/rabbit_misc.erl b/src/rabbit_misc.erl index ea9567dd7b..23a7980351 100644 --- a/src/rabbit_misc.erl +++ b/src/rabbit_misc.erl @@ -34,7 +34,7 @@ -export([execute_mnesia_transaction/2]). -export([execute_mnesia_tx_with_tail/1]). -export([ensure_ok/2]). --export([cookie_hash/0, tcp_name/3]). +-export([tcp_name/3]). -export([upmap/2, map_in_order/2]). -export([table_filter/3]). -export([dirty_read_all/1, dirty_foreach_key/2, dirty_dump_log/1]). @@ -141,7 +141,6 @@ -spec(execute_mnesia_tx_with_tail/1 :: (thunk(fun ((boolean()) -> B))) -> B | (fun ((boolean()) -> B))). -spec(ensure_ok/2 :: (ok_or_error(), atom()) -> 'ok'). --spec(cookie_hash/0 :: () -> string()). -spec(tcp_name/3 :: (atom(), inet:ip_address(), rabbit_networking:ip_port()) -> atom()). @@ -448,9 +447,6 @@ execute_mnesia_tx_with_tail(TxFun) -> ensure_ok(ok, _) -> ok; ensure_ok({error, Reason}, ErrorTag) -> throw({error, {ErrorTag, Reason}}). -cookie_hash() -> - base64:encode_to_string(erlang:md5(atom_to_list(erlang:get_cookie()))). - tcp_name(Prefix, IPAddress, Port) when is_atom(Prefix) andalso is_number(Port) -> list_to_atom( diff --git a/src/rabbit_nodes.erl b/src/rabbit_nodes.erl index 9a39d16b7a..ba695b8e78 100644 --- a/src/rabbit_nodes.erl +++ b/src/rabbit_nodes.erl @@ -16,7 +16,7 @@ -module(rabbit_nodes). --export([names/1, diagnostics/1, make/1, parts/1]). +-export([names/1, diagnostics/1, make/1, parts/1, cookie_hash/0]). -define(EPMD_TIMEOUT, 30000). @@ -31,6 +31,7 @@ -spec(diagnostics/1 :: ([node()]) -> string()). -spec(make/1 :: ({string(), string()} | string()) -> node()). -spec(parts/1 :: (node() | string()) -> {string(), string()}). +-spec(cookie_hash/0 :: () -> string()). -endif. @@ -64,7 +65,7 @@ diagnostics0() -> {ok, [[Home]]} -> {"- home dir: ~s", [Home]}; Other -> {"- no home dir: ~p", [Other]} end, - {"- cookie hash: ~s", [rabbit_misc:cookie_hash()]}]. + {"- cookie hash: ~s", [cookie_hash()]}]. diagnostics_host(Host) -> case names(Host) of @@ -90,3 +91,6 @@ parts(NodeStr) -> {Prefix, Suffix}; {Prefix, Suffix} -> {Prefix, tl(Suffix)} end. + +cookie_hash() -> + base64:encode_to_string(erlang:md5(atom_to_list(erlang:get_cookie()))). |
