updated config services to use getattr instead of hasattr to simplify code
This commit is contained in:
parent
852eb60ab9
commit
0749dcacb2
4 changed files with 17 additions and 15 deletions
|
@ -32,7 +32,7 @@ def get_router_id(node: CoreNodeBase) -> str:
|
|||
Helper to return the first IPv4 address of a node as its router ID.
|
||||
"""
|
||||
for ifc in node.netifs():
|
||||
if hasattr(ifc, "control") and ifc.control is True:
|
||||
if getattr(ifc, "control", False):
|
||||
continue
|
||||
for a in ifc.addrlist:
|
||||
a = a.split("/")[0]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue