for interface in interfaces:
logger.verbose('net:InitInterfaces interface %d: %r'%(device_id,interface))
logger.verbose('net:InitInterfaces macs = %r' % macs)
for interface in interfaces:
logger.verbose('net:InitInterfaces interface %d: %r'%(device_id,interface))
logger.verbose('net:InitInterfaces macs = %r' % macs)
- elif 'BRIDGE' in details:
- #The bridge inherits the mac of the first attached interface.
- if 'IFNAME' in details:
- ifname = details['IFNAME']
- device_id -= 1
- elif orig_ifname:
- ifname = orig_ifname
- device_id -= 1
+ elif 'BRIDGE' in details and 'IFNAME' in details:
+ # The bridge inherits the mac of the first attached interface.
+ ifname = details['IFNAME']
+ device_id -= 1
logger.log('net:InitInterfaces: Bridge detected. Adding %s to devices_map' % ifname)
devices_map[ifname] = removeBridgedIfaceDetails(details)
bridgeName = details['BRIDGE']
logger.log('net:InitInterfaces: Adding bridge %s' % bridgeName)
bridgeDetails = prepDetails(interface)
logger.log('net:InitInterfaces: Bridge detected. Adding %s to devices_map' % ifname)
devices_map[ifname] = removeBridgedIfaceDetails(details)
bridgeName = details['BRIDGE']
logger.log('net:InitInterfaces: Adding bridge %s' % bridgeName)
bridgeDetails = prepDetails(interface)
+ # Bring up the bridge devices
+ for bridge in bridgeDevices:
+ if not files_only and bridge in newdevs:
+ logger.verbose('net:InitInterfaces bringing up bridge %s' % bridge)
+ os.system("/sbin/ifup %s" % bridge)
+
details['NETMASK'] = interface['netmask']
details['GATEWAY'] = interface['gateway']
if interface['is_primary']:
details['NETMASK'] = interface['netmask']
details['GATEWAY'] = interface['gateway']
if interface['is_primary']: