summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2012-02-02 14:42:27 +0000
committerSimon MacMullen <simon@rabbitmq.com>2012-02-02 14:42:27 +0000
commit8404b667a687d2f5af11ab8a90c324c71857b8e7 (patch)
treea3de0e254f62106ffc9ac8d487649bdc026255c2
parent76c8d30ea771b5c01b2c7bdfd246517fe7474d44 (diff)
downloadrabbitmq-server-8404b667a687d2f5af11ab8a90c324c71857b8e7.tar.gz
Move cookie_hash/0 too.
-rw-r--r--src/rabbit.erl2
-rw-r--r--src/rabbit_misc.erl6
-rw-r--r--src/rabbit_nodes.erl8
3 files changed, 8 insertions, 8 deletions
diff --git a/src/rabbit.erl b/src/rabbit.erl
index 5ada38d2..23e258d3 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 ea9567dd..23a79803 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 9a39d16b..ba695b8e 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()))).