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

lib: nlcache: fix dry_run exception

error: link_set_bridge_info_data_dry_run() takes exactly 3 arguments (4 given)
error: link_set_brport_with_info_slave_data_dry_run() got an unexpected keyword argument 'kind'

seems like when updating a method, it's associated dry-run method wasn't
updated accordingly. Maybe there is a way to programmatically check that
I will look into it.

warning: bridge: skipping port X invalid ether addr
warning: interface not recognized - please check interface configuration
Won't show on dry-run anymore

Log info for commands executed with utils.exec_command() weren't prefixed with
DRY-RUN.

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
This commit is contained in:
Julien Fortin
2020-02-19 15:50:27 +01:00
parent 393524ab41
commit ca45cd9e83
4 changed files with 7 additions and 6 deletions

View File

@@ -2753,7 +2753,7 @@ class NetlinkListenerWithCache(nllistener.NetlinkManagerWithListener, BaseObject
except Exception as e:
raise Exception("%s: netlink: cannot create bridge or set attributes: %s" % (ifname, str(e)))
def link_set_bridge_info_data_dry_run(self, ifname, ifla_info_data):
def link_set_bridge_info_data_dry_run(self, ifname, ifla_info_data, link_just_created):
self.log_info_ifname_dry_run(ifname, "netlink: ip link add dev %s type bridge (with attributes)" % ifname)
self.logger.debug("attributes: %s" % ifla_info_data)
@@ -3006,7 +3006,7 @@ class NetlinkListenerWithCache(nllistener.NetlinkManagerWithListener, BaseObject
except Exception as e:
raise Exception("netlink: %s: cannot set %s (bridge slave) with options: %s" % (kind, ifname, str(e)))
def link_set_brport_with_info_slave_data_dry_run(self, ifname, _, __, ifla_info_slave_data):
def link_set_brport_with_info_slave_data_dry_run(self, ifname, kind, ifla_info_data, ifla_info_slave_data):
self.log_info_ifname_dry_run(ifname, "netlink: ip link set dev %s: bridge port attributes" % ifname)
self.logger.debug("attributes: %s" % ifla_info_slave_data)