daemon: refactored usages of addr to ip and updated functions to align
This commit is contained in:
parent
d88f3a2535
commit
20feea8f12
12 changed files with 138 additions and 118 deletions
|
@ -67,7 +67,7 @@ class FRRZebra(CoreService):
|
|||
# include control interfaces in addressing but not routing daemons
|
||||
if hasattr(iface, "control") and iface.control is True:
|
||||
cfg += " "
|
||||
cfg += "\n ".join(map(cls.addrstr, iface.all_ips()))
|
||||
cfg += "\n ".join(map(cls.addrstr, iface.ips()))
|
||||
cfg += "\n"
|
||||
continue
|
||||
cfgv4 = ""
|
||||
|
|
|
@ -64,7 +64,7 @@ class Zebra(CoreService):
|
|||
# include control interfaces in addressing but not routing daemons
|
||||
if getattr(iface, "control", False):
|
||||
cfg += " "
|
||||
cfg += "\n ".join(map(cls.addrstr, iface.all_ips()))
|
||||
cfg += "\n ".join(map(cls.addrstr, iface.ips()))
|
||||
cfg += "\n"
|
||||
continue
|
||||
cfgv4 = ""
|
||||
|
|
|
@ -74,7 +74,7 @@ class DefaultRouteService(UtilService):
|
|||
ifaces = node.get_ifaces()
|
||||
if ifaces:
|
||||
iface = ifaces[0]
|
||||
for ip in iface.all_ips():
|
||||
for ip in iface.ips():
|
||||
net = ip.cidr
|
||||
if net.size > 1:
|
||||
router = net[1]
|
||||
|
@ -118,7 +118,7 @@ class StaticRouteService(UtilService):
|
|||
cfg += "# NOTE: this service must be customized to be of any use\n"
|
||||
cfg += "# Below are samples that you can uncomment and edit.\n#\n"
|
||||
for iface in node.get_ifaces(control=False):
|
||||
cfg += "\n".join(map(cls.routestr, iface.all_ips()))
|
||||
cfg += "\n".join(map(cls.routestr, iface.ips()))
|
||||
cfg += "\n"
|
||||
return cfg
|
||||
|
||||
|
@ -241,7 +241,7 @@ max-lease-time 7200;
|
|||
ddns-update-style none;
|
||||
"""
|
||||
for iface in node.get_ifaces(control=False):
|
||||
cfg += "\n".join(map(cls.subnetentry, iface.all_ips()))
|
||||
cfg += "\n".join(map(cls.subnetentry, iface.ips()))
|
||||
cfg += "\n"
|
||||
return cfg
|
||||
|
||||
|
@ -555,10 +555,7 @@ export LANG
|
|||
% node.name
|
||||
)
|
||||
for iface in node.get_ifaces(control=False):
|
||||
body += "<li>%s - %s</li>\n" % (
|
||||
iface.name,
|
||||
[str(x) for x in iface.all_ips()],
|
||||
)
|
||||
body += "<li>%s - %s</li>\n" % (iface.name, [str(x) for x in iface.ips()])
|
||||
return "<html><body>%s</body></html>" % body
|
||||
|
||||
|
||||
|
@ -626,7 +623,7 @@ class RadvdService(UtilService):
|
|||
"""
|
||||
cfg = "# auto-generated by RADVD service (utility.py)\n"
|
||||
for iface in node.get_ifaces(control=False):
|
||||
prefixes = list(map(cls.subnetentry, iface.all_ips()))
|
||||
prefixes = list(map(cls.subnetentry, iface.ips()))
|
||||
if len(prefixes) < 1:
|
||||
continue
|
||||
cfg += (
|
||||
|
|
|
@ -40,7 +40,7 @@ class XorpRtrmgr(CoreService):
|
|||
for iface in node.get_ifaces():
|
||||
cfg += " interface %s {\n" % iface.name
|
||||
cfg += "\tvif %s {\n" % iface.name
|
||||
cfg += "".join(map(cls.addrstr, iface.all_ips()))
|
||||
cfg += "".join(map(cls.addrstr, iface.ips()))
|
||||
cfg += cls.lladdrstr(iface)
|
||||
cfg += "\t}\n"
|
||||
cfg += " }\n"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue