#NEWLINE# def plug( self , network , mac_address , gateway = True ) : #NEWLINE# #INDENT# vlan = network . get ( 'vlan' ) #NEWLINE# if ( vlan is not None ) : #NEWLINE# #INDENT# iface = ( CONF . vlan_interface or network [ 'bridge_interface' ] ) #NEWLINE# LinuxBridgeInterfaceDriver . ensure_vlan_bridge ( vlan , network [ 'bridge' ] , iface , network , mac_address , network . get ( 'mtu' ) ) #NEWLINE# iface = ( 'vlan%s' % vlan ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# iface = ( CONF . flat_interface or network [ 'bridge_interface' ] ) #NEWLINE# LinuxBridgeInterfaceDriver . ensure_bridge ( network [ 'bridge' ] , iface , gateway , gateway ) #NEWLINE# #UNINDENT# if ( network [ 'share_address' ] or CONF . share_dhcp_address ) : #NEWLINE# #INDENT# isolate_dhcp_address ( iface , network [ 'dhcp_server' ] ) #NEWLINE# #UNINDENT# iptables_manager . apply ( ) #NEWLINE# return network [ 'bridge' ]