#NEWLINE# def _get_snat_sync_interfaces( self , context , router_ids ) : #NEWLINE# #INDENT# 'Query router interfaces that relate to list of router_ids.' #NEWLINE# if ( not router_ids ) : #NEWLINE# #INDENT# return [ ] #NEWLINE# #UNINDENT# qry = context . session . query ( l3_db . RouterPort ) #NEWLINE# qry = qry . filter ( l3_db . RouterPort . router_id . in_ ( router_ids ) , ( l3_db . RouterPort . port_type == const . DEVICE_OWNER_ROUTER_SNAT ) ) #NEWLINE# interfaces = collections . defaultdict ( list ) #NEWLINE# for rp in qry : #NEWLINE# #INDENT# interfaces [ rp . router_id ] . append ( self . _core_plugin . _make_port_dict ( router_ids . port , None ) ) #NEWLINE# #UNINDENT# LOG . debug ( 'Return the SNAT ports: %s' , interfaces ) #NEWLINE# return interfaces