This commit is contained in:
Gabriele Santomaggio 2017-04-27 22:59:20 +02:00
parent a875fe52ef
commit 34e791851c
1 changed files with 6 additions and 4 deletions

View File

@ -20,18 +20,20 @@ defmodule RabbitMQ.CLI.Ctl.Commands.ListDiscoveryPeersCommand do
def scopes(), do: [:ctl, :diagnostics]
def formatter(), do: RabbitMQ.CLI.Formatters.Table
def formatter(), do: RabbitMQ.CLI.Formatters.Erlang
def merge_defaults(args, opts), do: {args, opts}
def scopes(), do: [:ctl, :diagnostics]
def validate([_|_], _) do
{:validation_failure, :too_many_args}
end
def validate(_, _), do: :ok
def run([], %{node: node_name, timeout: timeout}) do
:rabbit_misc.rpc_call(node_name, :rabbit_peer_discovery, :discover_cluster_nodes, [], timeout)
nodes = :rabbit_misc.rpc_call(node_name, :rabbit_peer_discovery, :discover_cluster_nodes, [], timeout)
case nodes do
{:ok, {[], _} } -> ""
result -> result
end
end
def usage, do: "list_discovery_peers"