daemon: removed usages of getattr and hasattr where possible
This commit is contained in:
parent
6ef458fc74
commit
c2a40dbb6b
9 changed files with 30 additions and 28 deletions
|
@ -66,7 +66,7 @@ class FRRZebra(CoreService):
|
|||
for iface in node.get_ifaces():
|
||||
cfg += "interface %s\n" % iface.name
|
||||
# include control interfaces in addressing but not routing daemons
|
||||
if hasattr(iface, "control") and iface.control is True:
|
||||
if iface.control:
|
||||
cfg += " "
|
||||
cfg += "\n ".join(map(cls.addrstr, iface.ips()))
|
||||
cfg += "\n"
|
||||
|
|
|
@ -63,7 +63,7 @@ class Zebra(CoreService):
|
|||
for iface in node.get_ifaces():
|
||||
cfg += "interface %s\n" % iface.name
|
||||
# include control interfaces in addressing but not routing daemons
|
||||
if getattr(iface, "control", False):
|
||||
if iface.control:
|
||||
cfg += " "
|
||||
cfg += "\n ".join(map(cls.addrstr, iface.ips()))
|
||||
cfg += "\n"
|
||||
|
|
|
@ -581,7 +581,7 @@ if [ "x$1" = "xstart" ]; then
|
|||
|
||||
"""
|
||||
for iface in node.get_ifaces():
|
||||
if hasattr(iface, "control") and iface.control is True:
|
||||
if iface.control:
|
||||
cfg += "# "
|
||||
redir = "< /dev/null"
|
||||
cfg += "tcpdump ${DUMPOPTS} -w %s.%s.pcap -i %s %s &\n" % (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue