2020-07-12 02:23:07 +08:00
|
|
|
## This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
## License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
## file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
2016-02-03 23:01:32 +08:00
|
|
|
##
|
2023-11-22 12:18:22 +08:00
|
|
|
## Copyright (c) 2007-2025 Broadcom. All Rights Reserved. The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. All rights reserved.
|
2016-02-03 23:01:32 +08:00
|
|
|
|
2016-02-03 22:42:45 +08:00
|
|
|
defmodule RabbitMQCtlTest do
|
2016-02-03 06:11:09 +08:00
|
|
|
use ExUnit.Case, async: false
|
|
|
|
import ExUnit.CaptureIO
|
2016-11-15 01:52:08 +08:00
|
|
|
import RabbitMQ.CLI.Core.ExitCodes
|
2016-04-02 01:58:47 +08:00
|
|
|
import TestHelper
|
2016-03-09 01:05:25 +08:00
|
|
|
|
2016-04-30 05:58:36 +08:00
|
|
|
setup_all do
|
2016-11-15 01:52:08 +08:00
|
|
|
RabbitMQ.CLI.Core.Distribution.start()
|
2017-06-07 23:21:53 +08:00
|
|
|
|
2017-02-15 18:44:25 +08:00
|
|
|
set_scope(:all)
|
2017-06-07 23:21:53 +08:00
|
|
|
|
2016-04-30 05:58:36 +08:00
|
|
|
:ok
|
|
|
|
end
|
|
|
|
|
2020-06-29 08:57:52 +08:00
|
|
|
#
|
|
|
|
# --help and `help [command]`
|
|
|
|
#
|
2019-01-31 05:45:52 +08:00
|
|
|
|
2020-06-29 08:57:52 +08:00
|
|
|
test "--help option prints help for the command and exits with an OK" do
|
2019-01-31 05:45:52 +08:00
|
|
|
command = ["status", "--help"]
|
2022-10-03 01:54:11 +08:00
|
|
|
|
2019-01-31 05:45:52 +08:00
|
|
|
assert capture_io(fn ->
|
2022-10-03 01:54:11 +08:00
|
|
|
error_check(command, exit_ok())
|
|
|
|
end) =~ ~r/Usage/
|
2019-01-31 05:45:52 +08:00
|
|
|
end
|
|
|
|
|
2020-06-29 08:57:52 +08:00
|
|
|
test "bare --help prints general help and exits with an OK" do
|
|
|
|
command = ["--help"]
|
2022-10-03 01:54:11 +08:00
|
|
|
|
2020-06-29 08:57:52 +08:00
|
|
|
assert capture_io(fn ->
|
2022-10-03 01:54:11 +08:00
|
|
|
error_check(command, exit_ok())
|
|
|
|
end) =~ ~r/Usage/
|
2020-06-29 08:57:52 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
test "help [command] prints help for the command and exits with an OK" do
|
|
|
|
command = ["help", "status"]
|
2022-10-03 01:54:11 +08:00
|
|
|
|
2020-06-29 08:57:52 +08:00
|
|
|
assert capture_io(fn ->
|
2022-10-03 01:54:11 +08:00
|
|
|
error_check(command, exit_ok())
|
|
|
|
end) =~ ~r/Usage/
|
2020-06-29 08:57:52 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
test "bare help command prints general help and exits with an OK" do
|
|
|
|
command = ["help"]
|
2022-10-03 01:54:11 +08:00
|
|
|
|
2020-06-29 08:57:52 +08:00
|
|
|
assert capture_io(fn ->
|
2022-10-03 01:54:11 +08:00
|
|
|
error_check(command, exit_ok())
|
|
|
|
end) =~ ~r/Usage/
|
2020-06-29 08:57:52 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
#
|
|
|
|
# Validation and Error Handling
|
|
|
|
#
|
|
|
|
|
2016-02-26 06:15:06 +08:00
|
|
|
test "print error message on a bad connection" do
|
2016-02-03 06:11:09 +08:00
|
|
|
command = ["status", "-n", "sandwich@pastrami"]
|
2022-10-03 01:54:11 +08:00
|
|
|
|
2016-11-04 19:11:03 +08:00
|
|
|
assert capture_io(:stderr, fn ->
|
2022-10-03 01:54:11 +08:00
|
|
|
error_check(command, exit_unavailable())
|
|
|
|
end) =~ ~r/unable to perform an operation on node 'sandwich@pastrami'/
|
2016-02-03 06:11:09 +08:00
|
|
|
end
|
|
|
|
|
2020-06-29 08:57:52 +08:00
|
|
|
test "when an RPC call times out, prints a timeout message" do
|
2016-03-22 01:59:22 +08:00
|
|
|
command = ["list_users", "-t", "0"]
|
2022-10-03 01:54:11 +08:00
|
|
|
|
2016-11-04 19:11:03 +08:00
|
|
|
assert capture_io(:stderr, fn ->
|
2022-10-03 01:54:11 +08:00
|
|
|
error_check(command, exit_tempfail())
|
|
|
|
end) =~
|
|
|
|
~r/Error: operation list_users on node #{get_rabbit_hostname()} timed out. Timeout value used: 0/
|
2016-03-09 01:05:25 +08:00
|
|
|
end
|
|
|
|
|
2020-06-29 08:57:52 +08:00
|
|
|
test "when authentication fails, prints an authentication error message" do
|
2022-10-03 01:54:11 +08:00
|
|
|
add_user("kirk", "khaaaaaan")
|
2016-04-02 01:58:47 +08:00
|
|
|
command = ["authenticate_user", "kirk", "makeitso"]
|
2022-10-03 01:54:11 +08:00
|
|
|
|
|
|
|
assert capture_io(
|
|
|
|
:stderr,
|
|
|
|
fn -> error_check(command, exit_dataerr()) end
|
|
|
|
) =~ ~r/Error: failed to authenticate user \"kirk\"/
|
|
|
|
|
|
|
|
delete_user("kirk")
|
2016-04-02 01:58:47 +08:00
|
|
|
end
|
|
|
|
|
2019-02-02 00:47:09 +08:00
|
|
|
test "when invoked without arguments, displays a generic usage message and exits with a non-zero code" do
|
2016-03-23 00:21:12 +08:00
|
|
|
command = []
|
2022-10-03 01:54:11 +08:00
|
|
|
|
2016-11-04 19:11:03 +08:00
|
|
|
assert capture_io(:stderr, fn ->
|
2022-10-03 01:54:11 +08:00
|
|
|
error_check(command, exit_usage())
|
|
|
|
end) =~ ~r/usage/i
|
2016-02-03 06:11:09 +08:00
|
|
|
end
|
|
|
|
|
2019-02-02 00:47:09 +08:00
|
|
|
test "when invoked with only a --help, shows a generic usage message and exits with a success" do
|
|
|
|
command = ["--help"]
|
2022-10-03 01:54:11 +08:00
|
|
|
|
2019-02-02 00:47:09 +08:00
|
|
|
assert capture_io(:stdio, fn ->
|
2022-10-03 01:54:11 +08:00
|
|
|
error_check(command, exit_ok())
|
|
|
|
end) =~ ~r/usage/i
|
2019-02-02 00:47:09 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
test "when invoked with --help [command], shows a generic usage message and exits with a success" do
|
|
|
|
command = ["--help", "status"]
|
2022-10-03 01:54:11 +08:00
|
|
|
|
2019-02-02 00:47:09 +08:00
|
|
|
assert capture_io(:stdio, fn ->
|
2022-10-03 01:54:11 +08:00
|
|
|
error_check(command, exit_ok())
|
|
|
|
end) =~ ~r/usage/i
|
2019-02-02 00:47:09 +08:00
|
|
|
end
|
|
|
|
|
2020-06-29 08:57:52 +08:00
|
|
|
test "when no command name is provided, displays usage" do
|
2016-03-23 00:21:12 +08:00
|
|
|
command = ["-n", "sandwich@pastrami"]
|
2022-10-03 01:54:11 +08:00
|
|
|
|
2016-11-04 19:11:03 +08:00
|
|
|
assert capture_io(:stderr, fn ->
|
2022-10-03 01:54:11 +08:00
|
|
|
error_check(command, exit_usage())
|
|
|
|
end) =~ ~r/usage/i
|
2016-02-03 06:11:09 +08:00
|
|
|
end
|
2016-03-05 05:35:54 +08:00
|
|
|
|
2019-04-12 05:43:54 +08:00
|
|
|
test "short node name without the host part connects properly" do
|
2016-04-30 05:58:36 +08:00
|
|
|
command = ["status", "-n", "rabbit"]
|
2024-12-05 00:10:46 +08:00
|
|
|
capture_io(:stdio, fn -> error_check(command, exit_ok()) end)
|
2016-04-30 05:58:36 +08:00
|
|
|
end
|
|
|
|
|
2020-06-29 08:57:52 +08:00
|
|
|
test "a non-existent command results in help message displayed" do
|
2016-03-23 00:21:12 +08:00
|
|
|
command = ["not_real"]
|
2022-10-03 01:54:11 +08:00
|
|
|
|
2016-11-04 19:11:03 +08:00
|
|
|
assert capture_io(:stderr, fn ->
|
2022-10-03 01:54:11 +08:00
|
|
|
error_check(command, exit_usage())
|
|
|
|
end) =~ ~r/Usage/
|
2016-03-05 05:35:54 +08:00
|
|
|
end
|
2016-03-08 06:45:50 +08:00
|
|
|
|
2020-06-29 08:57:52 +08:00
|
|
|
test "a command that's been provided extra arguments exits with a reasonable error code" do
|
2016-03-23 00:21:12 +08:00
|
|
|
command = ["status", "extra"]
|
2022-10-03 01:54:11 +08:00
|
|
|
|
|
|
|
output =
|
|
|
|
capture_io(:stderr, fn ->
|
|
|
|
error_check(command, exit_usage())
|
|
|
|
end)
|
|
|
|
|
2019-03-17 18:54:18 +08:00
|
|
|
assert output =~ ~r/too many arguments/
|
|
|
|
assert output =~ ~r/Usage/
|
|
|
|
assert output =~ ~r/status/
|
2016-03-23 00:21:12 +08:00
|
|
|
end
|
2016-03-22 01:59:22 +08:00
|
|
|
|
2020-06-29 08:57:52 +08:00
|
|
|
test "a command that's been provided insufficient arguments exits with a reasonable error code" do
|
2016-03-23 00:21:12 +08:00
|
|
|
command = ["list_user_permissions"]
|
2022-10-03 01:54:11 +08:00
|
|
|
|
|
|
|
output =
|
|
|
|
capture_io(:stderr, fn ->
|
|
|
|
error_check(command, exit_usage())
|
|
|
|
end)
|
|
|
|
|
2019-03-17 18:54:18 +08:00
|
|
|
assert output =~ ~r/not enough arguments/
|
|
|
|
assert output =~ ~r/Usage/
|
|
|
|
assert output =~ ~r/list_user_permissions/
|
2016-04-27 00:20:11 +08:00
|
|
|
end
|
|
|
|
|
2020-06-29 08:57:52 +08:00
|
|
|
test "a command that's provided an invalid argument exits a reasonable error" do
|
2016-04-27 00:20:11 +08:00
|
|
|
command = ["set_disk_free_limit", "2097152bytes"]
|
2017-02-28 23:16:54 +08:00
|
|
|
capture_io(:stderr, fn -> error_check(command, exit_dataerr()) end)
|
2016-03-23 00:21:12 +08:00
|
|
|
end
|
2016-03-22 02:29:50 +08:00
|
|
|
|
2020-06-29 08:57:52 +08:00
|
|
|
test "a command that fails with an error exits with a reasonable error code" do
|
2022-11-21 17:38:05 +08:00
|
|
|
command = ["set_vhost_tags", "voldemort", "mytag"]
|
|
|
|
capture_io(:stderr, fn -> error_check(command, exit_dataerr()) end)
|
2016-03-23 00:21:12 +08:00
|
|
|
end
|
2016-03-22 01:59:22 +08:00
|
|
|
|
2023-09-06 21:13:15 +08:00
|
|
|
test "a command with an unsupported option as the first command-line arg fails gracefully" do
|
2016-05-09 23:38:37 +08:00
|
|
|
command1 = ["--invalid=true", "list_permissions", "-p", "/"]
|
2022-10-03 01:54:11 +08:00
|
|
|
|
2016-11-04 19:11:03 +08:00
|
|
|
assert capture_io(:stderr, fn ->
|
2022-10-03 01:54:11 +08:00
|
|
|
error_check(command1, exit_usage())
|
|
|
|
end) =~ ~r/Invalid options for this command/
|
2016-05-09 23:38:37 +08:00
|
|
|
|
|
|
|
command2 = ["--node", "rabbit", "status", "quack"]
|
2022-10-03 01:54:11 +08:00
|
|
|
|
2016-11-04 19:11:03 +08:00
|
|
|
assert capture_io(:stderr, fn ->
|
2022-10-03 01:54:11 +08:00
|
|
|
error_check(command2, exit_usage())
|
|
|
|
end) =~ ~r/too many arguments./
|
2016-05-09 23:38:37 +08:00
|
|
|
|
2019-07-11 04:27:29 +08:00
|
|
|
command3 = ["--node", "rabbit", "add_user"]
|
2022-10-03 01:54:11 +08:00
|
|
|
|
2016-11-04 19:11:03 +08:00
|
|
|
assert capture_io(:stderr, fn ->
|
2022-10-03 01:54:11 +08:00
|
|
|
error_check(command3, exit_usage())
|
|
|
|
end) =~ ~r/not enough arguments./
|
2016-05-09 23:38:37 +08:00
|
|
|
end
|
|
|
|
|
2022-10-03 01:54:11 +08:00
|
|
|
## ------------------------- Default Flags ------------------------------------
|
2016-03-09 01:05:25 +08:00
|
|
|
|
2016-03-08 06:45:50 +08:00
|
|
|
test "an empty node option is filled with the default rabbit node" do
|
2016-08-09 02:43:09 +08:00
|
|
|
assert RabbitMQCtl.merge_all_defaults(%{})[:node] ==
|
2022-10-03 01:54:11 +08:00
|
|
|
TestHelper.get_rabbit_hostname()
|
2016-03-08 06:45:50 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
test "a non-empty node option is not overwritten" do
|
2016-08-09 02:43:09 +08:00
|
|
|
assert RabbitMQCtl.merge_all_defaults(%{node: :jake@thedog})[:node] ==
|
2022-10-03 01:54:11 +08:00
|
|
|
:jake@thedog
|
2016-03-08 06:45:50 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
test "an empty timeout option is set to infinity" do
|
2016-08-09 02:43:09 +08:00
|
|
|
assert RabbitMQCtl.merge_all_defaults(%{})[:timeout] == :infinity
|
2016-03-08 06:45:50 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
test "a non-empty timeout option is not overridden" do
|
2016-08-09 02:43:09 +08:00
|
|
|
assert RabbitMQCtl.merge_all_defaults(%{timeout: 60})[:timeout] == 60
|
2016-03-08 06:45:50 +08:00
|
|
|
end
|
2016-03-22 01:59:22 +08:00
|
|
|
|
2016-03-28 23:17:25 +08:00
|
|
|
test "other parameters are not overridden by the default" do
|
2016-08-09 02:43:09 +08:00
|
|
|
assert RabbitMQCtl.merge_all_defaults(%{vhost: "quack"})[:vhost] == "quack"
|
2016-03-28 23:17:25 +08:00
|
|
|
end
|
|
|
|
|
2016-05-05 03:40:09 +08:00
|
|
|
test "any flags that aren't global or command-specific cause a bad option" do
|
2016-05-05 04:21:18 +08:00
|
|
|
command1 = ["status", "--nod=rabbit"]
|
2022-10-03 01:54:11 +08:00
|
|
|
|
2016-11-04 19:11:03 +08:00
|
|
|
assert capture_io(:stderr, fn ->
|
2022-10-03 01:54:11 +08:00
|
|
|
error_check(command1, exit_usage())
|
|
|
|
end) =~ ~r/Invalid options for this command/
|
2016-05-05 04:21:18 +08:00
|
|
|
|
|
|
|
command2 = ["list_permissions", "-o", "/"]
|
2022-10-03 01:54:11 +08:00
|
|
|
|
2016-11-04 19:11:03 +08:00
|
|
|
assert capture_io(:stderr, fn ->
|
2022-10-03 01:54:11 +08:00
|
|
|
error_check(command2, exit_usage())
|
|
|
|
end) =~ ~r/Invalid options for this command/
|
2016-05-05 03:40:09 +08:00
|
|
|
end
|
2017-01-24 20:30:12 +08:00
|
|
|
|
2020-07-02 12:29:40 +08:00
|
|
|
#
|
|
|
|
# --auto-complete and `autocomplete [command]`
|
|
|
|
#
|
2017-01-24 22:40:31 +08:00
|
|
|
|
2020-07-02 12:29:40 +08:00
|
|
|
test "--auto-complete delegates to the autocomplete command" do
|
|
|
|
# Note: these are not script name (scope) aware without --script-name
|
|
|
|
# but the actual command invoked in a shell will be
|
|
|
|
check_output(["--auto-complete", "list_q"], "list_queues\n")
|
2022-10-03 01:54:11 +08:00
|
|
|
|
|
|
|
check_output(
|
|
|
|
["--auto-complete", "list_con", "--script-name", "rabbitmq-diagnostics"],
|
|
|
|
"list_connections\nlist_consumers\n"
|
|
|
|
)
|
|
|
|
|
|
|
|
check_output(
|
|
|
|
["--auto-complete", "--script-name", "rabbitmq-diagnostics", "mem"],
|
|
|
|
"memory_breakdown\n"
|
|
|
|
)
|
|
|
|
|
2020-07-02 12:29:40 +08:00
|
|
|
check_output(["--auto-complete", "--script-name", "rabbitmq-queues", "add_m"], "add_member\n")
|
2017-01-24 20:30:12 +08:00
|
|
|
end
|
|
|
|
|
2020-07-02 12:32:26 +08:00
|
|
|
test "autocompletion command used directly" do
|
|
|
|
# Note: these are not script name (scope) aware without --script-name
|
|
|
|
# but the actual command invoked in a shell will be
|
|
|
|
check_output(["autocomplete", "list_q"], "list_queues\n")
|
2022-10-03 01:54:11 +08:00
|
|
|
|
|
|
|
check_output(
|
|
|
|
["autocomplete", "list_con", "--script-name", "rabbitmq-diagnostics"],
|
|
|
|
"list_connections\nlist_consumers\n"
|
|
|
|
)
|
|
|
|
|
|
|
|
check_output(
|
|
|
|
["autocomplete", "--script-name", "rabbitmq-diagnostics", "mem"],
|
|
|
|
"memory_breakdown\n"
|
|
|
|
)
|
|
|
|
|
2020-07-02 12:32:26 +08:00
|
|
|
check_output(["autocomplete", "--script-name", "rabbitmq-queues", "add_m"], "add_member\n")
|
|
|
|
end
|
|
|
|
|
2017-01-24 20:30:12 +08:00
|
|
|
defp check_output(cmd, out) do
|
|
|
|
assert capture_io(fn ->
|
2022-10-03 01:54:11 +08:00
|
|
|
error_check(cmd, exit_ok())
|
|
|
|
end) == out
|
2017-01-24 20:30:12 +08:00
|
|
|
end
|
2017-05-24 19:08:03 +08:00
|
|
|
|
2022-10-03 01:54:11 +08:00
|
|
|
## ------------------------- Error formatting ---------------------------------
|
2017-05-24 19:08:03 +08:00
|
|
|
|
|
|
|
test "badrpc nodedown error" do
|
|
|
|
exit_code = exit_unavailable()
|
|
|
|
node = :example@node
|
2022-10-03 01:54:11 +08:00
|
|
|
|
2017-07-05 03:34:39 +08:00
|
|
|
{:error, ^exit_code, message} =
|
2022-10-03 01:54:11 +08:00
|
|
|
RabbitMQCtl.handle_command_output(
|
|
|
|
{:error, {:badrpc, :nodedown}},
|
|
|
|
:no_command,
|
|
|
|
%{node: node},
|
|
|
|
fn output, _, _ -> output end
|
|
|
|
)
|
2017-05-24 19:08:03 +08:00
|
|
|
|
2017-07-05 03:34:39 +08:00
|
|
|
assert message =~ ~r/Error: unable to perform an operation on node/
|
|
|
|
assert message =~ ~r/DIAGNOSTICS/
|
|
|
|
assert message =~ ~r/attempted to contact/
|
2017-05-24 19:08:03 +08:00
|
|
|
|
|
|
|
localnode = :non_existent_node@localhost
|
2022-10-03 01:54:11 +08:00
|
|
|
|
2017-07-05 03:34:39 +08:00
|
|
|
{:error, ^exit_code, message} =
|
2022-10-03 01:54:11 +08:00
|
|
|
RabbitMQCtl.handle_command_output(
|
|
|
|
{:error, {:badrpc, :nodedown}},
|
|
|
|
:no_command,
|
|
|
|
%{node: localnode},
|
|
|
|
fn output, _, _ -> output end
|
|
|
|
)
|
|
|
|
|
2017-07-05 03:34:39 +08:00
|
|
|
assert message =~ ~r/DIAGNOSTICS/
|
|
|
|
assert message =~ ~r/attempted to contact/
|
|
|
|
assert message =~ ~r/suggestion: start the node/
|
2017-05-24 19:08:03 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
test "badrpc timeout error" do
|
|
|
|
exit_code = exit_tempfail()
|
|
|
|
timeout = 1000
|
|
|
|
nodename = :node@host
|
2022-10-03 01:54:11 +08:00
|
|
|
|
|
|
|
err_msg =
|
|
|
|
"Error: operation example on node node@host timed out. Timeout value used: #{timeout}"
|
|
|
|
|
2017-05-24 19:08:03 +08:00
|
|
|
{:error, ^exit_code, ^err_msg} =
|
|
|
|
RabbitMQCtl.handle_command_output(
|
2022-10-03 01:54:11 +08:00
|
|
|
{:error, {:badrpc, :timeout}},
|
|
|
|
ExampleCommand,
|
|
|
|
%{timeout: timeout, node: nodename},
|
|
|
|
fn output, _, _ -> output end
|
|
|
|
)
|
2017-05-24 19:08:03 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
test "generic error" do
|
2019-01-23 15:43:49 +08:00
|
|
|
exit_code = exit_unavailable()
|
2022-10-03 01:54:11 +08:00
|
|
|
|
2017-05-24 19:08:03 +08:00
|
|
|
{:error, ^exit_code, "Error:\nerror message"} =
|
2017-06-06 19:20:18 +08:00
|
|
|
RabbitMQCtl.handle_command_output(
|
|
|
|
{:error, "error message"},
|
2022-10-03 01:54:11 +08:00
|
|
|
:no_command,
|
|
|
|
%{},
|
|
|
|
fn output, _, _ -> output end
|
|
|
|
)
|
2017-05-24 19:08:03 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
test "inspect arbitrary error" do
|
2019-01-23 15:43:49 +08:00
|
|
|
exit_code = exit_unavailable()
|
2017-05-24 19:08:03 +08:00
|
|
|
error = %{i: [am: "arbitrary", error: 1]}
|
|
|
|
inspected = inspect(error)
|
2022-10-03 01:54:11 +08:00
|
|
|
|
2017-05-24 19:08:03 +08:00
|
|
|
{:error, ^exit_code, "Error:\n" <> ^inspected} =
|
2017-06-06 19:20:18 +08:00
|
|
|
RabbitMQCtl.handle_command_output(
|
|
|
|
{:error, error},
|
2022-10-03 01:54:11 +08:00
|
|
|
:no_command,
|
|
|
|
%{},
|
|
|
|
fn output, _, _ -> output end
|
|
|
|
)
|
2017-05-24 19:08:03 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
test "atom error" do
|
2019-01-23 15:43:49 +08:00
|
|
|
exit_code = exit_unavailable()
|
2022-10-03 01:54:11 +08:00
|
|
|
|
2017-05-24 19:08:03 +08:00
|
|
|
{:error, ^exit_code, "Error:\nerror_message"} =
|
2017-06-06 19:20:18 +08:00
|
|
|
RabbitMQCtl.handle_command_output(
|
|
|
|
{:error, :error_message},
|
2022-10-03 01:54:11 +08:00
|
|
|
:no_command,
|
|
|
|
%{},
|
|
|
|
fn output, _, _ -> output end
|
|
|
|
)
|
2017-05-24 19:08:03 +08:00
|
|
|
end
|
2016-02-03 06:11:09 +08:00
|
|
|
end
|