def find_port_and_cluster(clusters, port_id):
 for c in clusters:
  query = ('/ws.v1/lswitch/*/lport?uuid=%s&fields=*' % port_id)
  LOG.debug(_("Looking for lswitch with port id '%(port_id)s' on: %(c)s"), locals())
  try:
   res = do_single_request(HTTP_GET, query, cluster=c)
  except Exception as e:
   LOG.error(_('get_port_cluster_and_url, exception: %s'), str(e))
   continue
  res = json.loads(res)
  if (len(res['results']) == 1):
   return (res['results'][0], c)
 return (None, None)

def find_port_and_cluster ( clusters , port_id ) : for c in clusters : query = ( '/ws.v1/lswitch/*/lport?uuid=%s&fields=*' % port_id ) LOG . debug ( _ ( "Looking for lswitch with port id '%(port_id)s' on: %(c)s" ) , locals ( ) ) try : res = do_single_request ( HTTP_GET , query , cluster = c ) except Exception as e : LOG . error ( _ ( 'get_port_cluster_and_url, exception: %s' ) , str ( e ) ) continue res = json . loads ( res ) if ( len ( res [ 'results' ] ) == 1 ) : return ( res [ 'results' ] [ 0 ] , c ) return ( None , None )
return of port or if port does not exist .