def get_netdev_by_mac(mac):
maybe = None
for device in os.listdir("/sys/class/net"):
- dev_mac = get_netdev_by_mac(device)
+ dev_mac = get_netdev_mac(device)
if dev_mac and mac.lower() == dev_mac.lower():
if get_netdev_tx_queue_len(device):
return device
for line in oc['static-routes'].split(','):
network, masklen, gateway = line.split('/')
run_command(['/sbin/ip', 'route', 'add',
- '%s/%s' % (netmask, masklen), 'via', gateway,
+ '%s/%s' % (network, masklen), 'via', gateway,
'dev', ipdev])
settings, offload = ethtool_settings(oc)
argv = ['--del-match=bonding.%s.[!0-9]*' % interface]
argv += ["--add=bonding.%s.slave=%s" % (interface, slave)
for slave in physdevs]
+ argv += ['--add=bonding.%s.fake-iface=true']
if pifrec['MAC'] != "":
argv += ['--add=port.%s.mac=%s' % (interface, pifrec['MAC'])]
argv += configure_bond(bond_master)
modify_config(argv)
- # Configure network devices.
- configure_netdev(pif)
-
# Bring up VLAN slave, plus physical devices other than bond
# slaves (which we brought up earlier).
if vlan_slave:
for physdev in set(physdevs) - set(bond_slave_physdevs):
up_netdev(physdev)
+ # Configure network devices.
+ configure_netdev(pif)
+
# Update /etc/issue (which contains the IP address of the management interface)
os.system("/sbin/update-issue")