def sift_port_white_list(port_white_list, registered_io_ports):
 valid_port_list = []
 LOG.debug('Filter ports in [%(white)s}] but not in [%(reg_ports)s].', {'white': ','.join([port.display_name for port in port_white_list]), 'reg_ports': ','.join([port.display_name for port in registered_io_ports])})
 for io_port in port_white_list:
  if (io_port not in registered_io_ports):
   LOG.debug('Skipped SP port %(port)s due to it is not registered. The registered IO ports: %(reg_ports)s.', {'port': io_port, 'reg_ports': registered_io_ports})
  else:
   valid_port_list.append(io_port)
 return valid_port_list

def sift_port_white_list ( port_white_list , registered_io_ports ) : valid_port_list = [ ] LOG . debug ( 'Filter ports in [%(white)s}] but not in [%(reg_ports)s].' , { 'white' : ',' . join ( [ port . display_name for port in port_white_list ] ) , 'reg_ports' : ',' . join ( [ port . display_name for port in registered_io_ports ] ) } ) for io_port in port_white_list : if ( io_port not in registered_io_ports ) : LOG . debug ( 'Skipped SP port %(port)s due to it is not registered. The registered IO ports: %(reg_ports)s.' , { 'port' : io_port , 'reg_ports' : registered_io_ports } ) else : valid_port_list . append ( io_port ) return valid_port_list
filters out the unregistered ports .