Fixes port names not correctly formatted

This commit is contained in:
Matteo Biscosi 2026-02-23 17:33:50 +00:00
parent 832a7de8fe
commit 1d48ea3535

View file

@ -1006,8 +1006,14 @@ function format_portidx_name(device_ip, portidx, short_version)
cached_val = cache_utils.getifname(device_ip, portidx)
if (cached_val ~= nil) then
local num_value = tonumber(cached_val)
if(num_value and (num_value == tonumber(portidx))) then
-- With integer it seems there is some problem when caching the value
-- returning values like 6.00000 instead of 6
return(portidx)
end
if(short_version) then
cached_val = shortenString(cached_val, 26)
cached_val = shortenString(cached_val, 26)
end
-- if(cached_val ~= portidx) then