gluon-core: fix gluon.util.get_role_interfaces() with empty role list (#2472)
The function failed when an interface has no roles assigned, breaking several upgrade scripts. Closes #2471
This commit is contained in:
parent
4225bd3853
commit
1252871217
@ -158,7 +158,8 @@ function M.get_role_interfaces(uci, role, exclusive)
|
|||||||
end
|
end
|
||||||
|
|
||||||
uci:foreach('gluon', 'interface', function(s)
|
uci:foreach('gluon', 'interface', function(s)
|
||||||
if M.contains(s.role, role) and (not exclusive or #s.role == 1) then
|
local roles = s.role or {}
|
||||||
|
if M.contains(roles, role) and (not exclusive or #roles == 1) then
|
||||||
add(s.name)
|
add(s.name)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
Loading…
Reference in New Issue
Block a user