Repository URL to install this package:
|
Version:
2.5 ▾
|
ó
µEYc @ s d d l Z d d l m Z d d l Z d d l m Z e j e j d e f d Y Z d e f d YZ d e f d YZ
d S(
iÿÿÿÿN( t
positional( t
exceptionst ServiceCatalogc B sÑ e Z d Z d Z d Z e d Z e j d Z e
d Z e d d d d d d d Z d d Z e j e d d d d d d d Z e d d d d d d d
Z RS( s; Helper methods for dealing with a Keystone Service Catalog.c C s
| | _ d S( N( t _catalog( t selft catalog( ( sY /home/tvault/.virtenv/lib/python2.7/site-packages/keystoneauth1/access/service_catalog.pyt __init__ s c C s | j d p | j d S( Nt region_idt region( t get( R t endpoint( ( sY /home/tvault/.virtenv/lib/python2.7/site-packages/keystoneauth1/access/service_catalog.pyt _get_endpoint_region" s c C s | j S( s Return the raw service catalog content, mostly useful for debugging.
Applications should avoid this and use accessor methods instead.
However, there are times when inspecting the raw catalog can be useful
for analysis and other reasons.
( R ( R ( ( sY /home/tvault/.virtenv/lib/python2.7/site-packages/keystoneauth1/access/service_catalog.pyR % s c C s d S( s¼ Helper function to normalize endpoint matching across v2 and v3.
:returns: True if the provided endpoint matches the required
interface otherwise False.
N( ( R R
t interface( ( sY /home/tvault/.virtenv/lib/python2.7/site-packages/keystoneauth1/access/service_catalog.pyt is_interface_match/ s c C s | S( s Handle differences in the way v2 and v3 catalogs specify endpoint.
Both v2 and v3 must be able to handle the endpoint style of the other.
For example v2 must be able to handle a 'public' interface and
v3 must be able to handle a 'publicURL' interface.
:returns: the endpoint string in the format appropriate for this
service catalog.
( ( R R ( ( sY /home/tvault/.virtenv/lib/python2.7/site-packages/keystoneauth1/access/service_catalog.pyt normalize_interface7 s c
C sr | j | } i } xV| j p$ g D]E} y | d } Wn t k
rO q% n X| rh | | k rh q% n | r¥ y | d }
Wn t k
r q¥ X| |
k r¥ q% q¥ n | rÍ d | k rÍ | | d k rÍ q% n | j | g } x | j d g D]t } | r| j | | rqò n | r8| | j | k r8qò n | rY| | j d k rYqò n | j | qò Wq% W| S( s¤ Fetch and filter endpoints for the specified service(s).
Returns endpoints for the specified service (or all) containing
the specified type (or all) and region (or all) and service name.
If there is no name in the service catalog the service_name check will
be skipped. This allows compatibility with services that existed
before the name was available in the catalog.
t typet namet idt endpoints( R R t KeyErrort
setdefaultR R
R t append(
R t service_typeR t region_namet service_namet
service_idt endpoint_idt sct servicet stt snR R
( ( sY /home/tvault/.virtenv/lib/python2.7/site-packages/keystoneauth1/access/service_catalog.pyt
get_endpointsD s<