<s> from neutron . extensions import portbindings <EOL> from neutron . plugins . ml2 import driver_api as api <EOL> from neutron . plugins . ml2 . drivers . openvswitch . mech_driver import ( <EOL> mech_openvswitch as base ) <EOL> from oslo_log import log <EOL> from gbpservice . neutron . services . servicechain . plugins . ncp import plumber_base <EOL> LOG = log . getLogger ( __name__ ) <EOL> class TrafficStitchingMechanismGBPDriver ( base . OpenvswitchMechanismDriver ) : <EOL> """<STR_LIT>""" <EOL> def try_to_bind_segment_for_agent ( self , context , segment , agent ) : <EOL> vif_details = self . vif_details <EOL> if self . check_segment_for_agent ( segment , agent ) : <EOL> if context . current [ '<STR_LIT:name>' ] . startswith ( <EOL> '<STR_LIT>' + plumber_base . SERVICE_TARGET_NAME_PREFIX ) : <EOL> vif_details = { portbindings . CAP_PORT_FILTER : False , <EOL> portbindings . OVS_HYBRID_PLUG : False } <EOL> context . set_binding ( <EOL> segment [ api . ID ] , self . vif_type , vif_details ) <EOL> return True <EOL> else : <EOL> return False </s>
