Fix `rabbitmqctl status` when the disk_free cannot be determined

By adjusting RabbitMQ.CLI.InformationUnit to no longer attempt to
convert non-numeric values
This commit is contained in:
Philip Kuryloski 2022-05-25 15:46:33 +02:00
parent b7b73302f9
commit 9dc9b92a94
1 changed files with 6 additions and 2 deletions

View File

@ -30,14 +30,18 @@ defmodule RabbitMQ.CLI.InformationUnit do
:rabbit_resource_monitor_misc.parse_information_unit(val)
end
def convert(bytes, "bytes") do
def convert(bytes, "bytes") when is_number(bytes) do
bytes
end
def convert(bytes, unit) do
def convert(bytes, unit) when is_number(bytes) do
do_convert(bytes, String.downcase(unit))
end
def convert(:unknown, _) do
:unknown
end
def known_unit?(val) do
MapSet.member?(known_units(), String.downcase(val))
end