#NEWLINE# @ log_helpers . log_method_call #NEWLINE# def get_ports_on_host_by_subnet( self , context , host , subnet ) : #NEWLINE# #INDENT# 'Returns DVR serviced ports on a given subnet in the input host\n\n        This method returns ports that need to be serviced by DVR.\n        :param context: rpc request context\n        :param host: host id to match and extract ports of interest\n        :param subnet: subnet id to match and extract ports of interest\n        :returns list -- Ports on the given subnet in the input host\n        ' #NEWLINE# filters = { #NEWLINE# #INDENT# 'fixed_ips' : { #NEWLINE# #INDENT# 'subnet_id' : [ subnet ] , #NEWLINE# #UNINDENT# } , #NEWLINE# portbindings . HOST_ID : [ host ] , #NEWLINE# #UNINDENT# } #NEWLINE# ports_query = self . plugin . _get_ports_query ( context , filters = filters ) #NEWLINE# owner_filter = or_ ( models_v2 . Port . device_owner . startswith ( constants . DEVICE_OWNER_COMPUTE_PREFIX ) , models_v2 . Port . device_owner . in_ ( utils . get_other_dvr_serviced_device_owners ( ) ) ) #NEWLINE# ports_query = ports_query . filter ( owner_filter ) #NEWLINE# ports = [ self . plugin . _make_port_dict ( port , process_extensions = False ) for port in ports_query . all ( ) ] #NEWLINE# LOG . debug ( 'Returning list of dvr serviced ports on host %(host)s for subnet %(subnet)s ports %(ports)s' , { #NEWLINE# #INDENT# 'host' : host , #NEWLINE# 'subnet' : subnet , #NEWLINE# 'ports' : ports , #NEWLINE# #UNINDENT# } ) #NEWLINE# return ports