#NEWLINE# def _bind_ha_router_to_agents( self , plugin , context , router_id , chosen_agents ) : #NEWLINE# #INDENT# port_bindings = plugin . get_ha_router_port_bindings ( context , [ router_id ] ) #NEWLINE# for ( port_binding , agent ) in zip ( port_bindings , chosen_agents ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# with db_api . autonested_transaction ( context . session ) : #NEWLINE# #INDENT# port_binding . l3_agent_id = self . id #NEWLINE# self . bind_router ( context , router_id , agent ) #NEWLINE# #UNINDENT# #UNINDENT# except db_exc . DBDuplicateEntry : #NEWLINE# #INDENT# LOG . debug ( 'Router %(router)s already scheduled for agent %(agent)s' , { #NEWLINE# #INDENT# 'router' : router_id , #NEWLINE# 'agent' : agent . id , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# LOG . debug ( 'HA Router %(router_id)s is scheduled to L3 agent %(agent_id)s)' , { #NEWLINE# #INDENT# 'router_id' : router_id , #NEWLINE# 'agent_id' : agent . id , #NEWLINE# #UNINDENT# } )