Skip to content

Commit 6cf9339

Browse files
committed
Refactor leader_health_check command validators and ignore vhost arg
1 parent 857e2a7 commit 6cf9339

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

deps/rabbitmq_cli/lib/rabbitmq/cli/queues/commands/leader_health_check_command.ex

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,8 @@ defmodule RabbitMQ.CLI.Queues.Commands.LeaderHealthCheckCommand do
1414
def scopes(), do: [:queues]
1515

1616
use RabbitMQ.CLI.Core.AcceptsDefaultSwitchesAndTimeout
17-
17+
use RabbitMQ.CLI.Core.AcceptsOnePositionalArgument
1818
use RabbitMQ.CLI.Core.MergesDefaultVirtualHost
19-
20-
def validate(args, _) when length(args) < 1 do
21-
{:validation_failure, :not_enough_args}
22-
end
23-
24-
def validate(args, _) when length(args) > 1 do
25-
{:validation_failure, :too_many_args}
26-
end
27-
2819
use RabbitMQ.CLI.Core.RequiresRabbitAppRunning
2920

3021
def run([pattern] = _args, %{node: node_name, vhost: vhost}) do
@@ -41,7 +32,7 @@ defmodule RabbitMQ.CLI.Queues.Commands.LeaderHealthCheckCommand do
4132
{:error, :check_passed}
4233
end
4334

44-
def output({:error, unhealthy_queues}, %{vhost: vhost, formatter: "json"}) when is_list(unhealthy_queues) do
35+
def output({:error, unhealthy_queues}, %{vhost: _vhost, formatter: "json"}) when is_list(unhealthy_queues) do
4536
lines = queue_lines(unhealthy_queues)
4637

4738
{:error, :check_failed, Enum.join(lines, line_separator())}

0 commit comments

Comments
 (0)