diff options
author | Simon MacMullen <simon@rabbitmq.com> | 2012-05-01 12:26:18 +0100 |
---|---|---|
committer | Simon MacMullen <simon@rabbitmq.com> | 2012-05-01 12:26:18 +0100 |
commit | cafaa1943a0e20b010449a1908c459f76b848107 (patch) | |
tree | 01ec7325dfe9ec72c5f55e7cd3bc3e8c88ee82fd /src/rabbit_nodes.erl | |
parent | 014d5695aa658fcb68592bbc41544808db34caf0 (diff) | |
parent | 170102611c47f8bafd7ebfd5a29a76803011e33c (diff) | |
download | rabbitmq-server-cafaa1943a0e20b010449a1908c459f76b848107.tar.gz |
Merge bug 24196.
Diffstat (limited to 'src/rabbit_nodes.erl')
-rw-r--r-- | src/rabbit_nodes.erl | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/rabbit_nodes.erl b/src/rabbit_nodes.erl index 28ba4698..1c23632d 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, cookie_hash/0]). +-export([names/1, diagnostics/1, make/1, parts/1, cookie_hash/0, is_running/2]). -define(EPMD_TIMEOUT, 30000). @@ -32,6 +32,7 @@ -spec(make/1 :: ({string(), string()} | string()) -> node()). -spec(parts/1 :: (node() | string()) -> {string(), string()}). -spec(cookie_hash/0 :: () -> string()). +-spec(is_running/2 :: (node(), atom()) -> boolean()). -endif. @@ -91,3 +92,9 @@ parts(NodeStr) -> cookie_hash() -> base64:encode_to_string(erlang:md5(atom_to_list(erlang:get_cookie()))). + +is_running(Node, Application) -> + case rpc:call(Node, application, which_applications, [infinity]) of + {badrpc, _} -> false; + Apps -> proplists:is_defined(Application, Apps) + end. |