<s> """<STR_LIT>""" <EOL> import logging <EOL> from networking_bagpipe . agent import bagpipe_bgp_agent <EOL> from neutron_lib import constants as n_const <EOL> from neutron . agent . l2 import agent_extension <EOL> from neutron . plugins . ml2 . drivers . openvswitch . agent . common import constants as ovs_agt_constants <EOL> from neutron . plugins . ml2 . drivers . openvswitch . agent . openflow . native import br_tun as native_br_tun <EOL> from neutron . plugins . ml2 . drivers . openvswitch . agent . openflow . ovs_ofctl import br_tun as ofctl_br_tun <EOL> LOG = logging . getLogger ( __name__ ) <EOL> class OVSBridgeIntercept ( ofctl_br_tun . OVSTunnelBridge , <EOL> native_br_tun . OVSTunnelBridge ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , bridge ) : <EOL> """<STR_LIT>""" <EOL> self . bridge = bridge <EOL> self . intercept_method ( "<STR_LIT>" ) <EOL> def intercept_method ( self , method_name ) : <EOL> method = getattr ( self . bridge . __class__ , method_name , None ) <EOL> if method is not None : <EOL> setattr ( self , method_name , <EOL> lambda * args , ** kwargs : method ( self , * args , ** kwargs ) ) <EOL> def __getattr__ ( self , name ) : <EOL> return getattr ( self . bridge , name ) <EOL> class BagpipeBgpvpnAgentExtension ( agent_extension . AgentCoreResourceExtension ) : <EOL> def initialize ( self , connection , driver_type ) : <EOL> if driver_type != ovs_agt_constants . EXTENSION_DRIVER_TYPE : <EOL> raise Exception ( "<STR_LIT>" <EOL> "<STR_LIT>" ) <EOL> self . bagpipe_bgp_agent = bagpipe_bgp_agent . BaGPipeBGPAgent ( <EOL> n_const . AGENT_TYPE_OVS , <EOL> connection , <EOL> int_br = self . int_br , <EOL> tun_br = OVSBridgeIntercept ( self . tun_br ) , <EOL> ) <EOL> def consume_api ( self , agent_api ) : <EOL> self . int_br = agent_api . request_int_br ( ) <EOL> self . tun_br = agent_api . request_tun_br ( ) <EOL> def handle_port ( self , context , data ) : <EOL> pass <EOL> def delete_port ( self , context , data ) : <EOL> pass </s>
