1
0
mirror of https://github.com/CumulusNetworks/ifupdown2.git synced 2024-05-06 15:54:50 +00:00

nlcache: link_del: move log.info after get_ifindex check

if the link doesn't exists get_ifindex will raise an exception
new code in the bridge module simply call link_del on a dummy port
that may not exists. It was a bit confusing to see the log.info
stating that a port was getting removed...

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
This commit is contained in:
Julien Fortin
2020-06-26 14:49:24 +02:00
parent ca43693778
commit 5f0ba5190f

View File

@@ -2553,9 +2553,11 @@ class NetlinkListenerWithCache(nllistener.NetlinkManagerWithListener, BaseObject
:param ifname:
:return:
"""
self.logger.info("%s: netlink: ip link del %s" % (ifname, ifname))
try:
ifindex = self.cache.get_ifindex(ifname)
self.logger.info("%s: netlink: ip link del %s" % (ifname, ifname))
debug = RTM_DELLINK in self.debug
link = Link(RTM_DELLINK, debug, use_color=self.use_color)