def find_router_gw_port(context, cluster, router_id):
 results = query_lrouter_lports(cluster, router_id, relations='LogicalPortAttachment')
 for lport in results:
  if ('_relations' in lport):
   attachment = lport['_relations'].get('LogicalPortAttachment')
   if (attachment and (attachment.get('type') == 'L3GatewayAttachment')):
    return lport

def find_router_gw_port ( context , cluster , router_id ) : results = query_lrouter_lports ( cluster , router_id , relations = 'LogicalPortAttachment' ) for lport in results : if ( '_relations' in lport ) : attachment = lport [ '_relations' ] . get ( 'LogicalPortAttachment' ) if ( attachment and ( attachment . get ( 'type' ) == 'L3GatewayAttachment' ) ) : return lport
retrieves the external gateway port for a nvp logical router .