Hide host pools selection in the default recipient

This commit is contained in:
Alfredo Cardigliano 2022-02-23 15:53:23 +01:00
parent 7a225929ed
commit fb441a73a6
4 changed files with 8 additions and 31 deletions

View file

@ -70,34 +70,6 @@ end
-- ##############################################
-- @brief Parses and validates a comma-separated list of interface pool ids into a lua array
-- @return A lua array of valid ids
function recipients_rest_utils.parse_interface_pools(pools_string)
local pools = interface_pools:get_all_pools()
local pools_list = {}
if isEmptyString(pools_string) then return pools_list end
-- Unfold the pools csv
pools_list = pools_string:split(",") or {pools_string}
local res = {}
for _, pool_id in pairs(pools_list) do
local pool_id = tonumber(pool_id)
for _, pool in pairs(pools) do
if pool_id == pool.pool_id then
res[#res + 1] = pool_id
break
end
end
end
return res
end
-- ##############################################
-- @brief Parses and validates a severity id string and returns it as a number
-- @param minimum_severity_id_string An string with an integer severity id as found in `alert_severities`
-- @return A valid integer severity id or nil when validation fails