Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
idna / lib / python2.7 / site-packages / keystoneauth1 / access / service_catalog.pyc
Size: Mime:
ó
µEYc@sddlZddlmZddlZddlmZejejƒdefd„ƒYƒZdefd„ƒYZ	defd	„ƒYZ
dS(
iÿÿÿÿN(t
positional(t
exceptionstServiceCatalogc	BsÑeZdZd„Zd„Zed„ƒZejd„ƒZ	e
d„ƒZeƒddddddd„ƒZdd„Zejeƒddddddd	„ƒƒZeƒddddddd
„ƒZRS(s;Helper methods for dealing with a Keystone Service Catalog.cCs
||_dS(N(t_catalog(tselftcatalog((sY/home/tvault/.virtenv/lib/python2.7/site-packages/keystoneauth1/access/service_catalog.pyt__init__scCs|jdƒp|jdƒS(Nt	region_idtregion(tget(Rtendpoint((sY/home/tvault/.virtenv/lib/python2.7/site-packages/keystoneauth1/access/service_catalog.pyt_get_endpoint_region"scCs|jS(sReturn 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%scCsdS(s¼Helper function to normalize endpoint matching across v2 and v3.

        :returns: True if the provided endpoint matches the required
                  interface otherwise False.
        N((RR
t	interface((sY/home/tvault/.virtenv/lib/python2.7/site-packages/keystoneauth1/access/service_catalog.pytis_interface_match/scCs|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.
        ((RR((sY/home/tvault/.virtenv/lib/python2.7/site-packages/keystoneauth1/access/service_catalog.pytnormalize_interface7sc
Csr|j|ƒ}i}xV|jp$gD]E}y|d}	Wntk
rOq%nX|rh||	krhq%n|r¥y|d}
Wntk
rq¥X||
kr¥q%q¥n|rÍd|krÍ||dkrÍq%n|j|	gƒ}xˆ|jdgƒD]t}|r|j||ƒrqòn|r8||j|ƒkr8qòn|rY||jdƒkrYqò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.
        ttypetnametidt	endpoints(RRtKeyErrort
setdefaultR	R
Rtappend(
Rtservice_typeRtregion_nametservice_namet
service_idtendpoint_idtsctservicetsttsnRR
((sY/home/tvault/.virtenv/lib/python2.7/site-packages/keystoneauth1/access/service_catalog.pyt
get_endpointsDs<


	"cKsc|jd||}|r0|j|gƒ}n/gtj|ƒD]}|D]}|^qJq@}|S(NR(RR	tsixt
itervalues(RRtkwargstsc_endpointsRR
tx((sY/home/tvault/.virtenv/lib/python2.7/site-packages/keystoneauth1/access/service_catalog.pyt_get_service_endpoints‚stpubliccCs
tƒ‚dS(saFetch endpoint urls from the service catalog.

        Fetch the endpoints from the service catalog for a particular
        endpoint attribute. If no attribute is given, return the first
        endpoint of the specified type.

        :param string service_type: Service type of the endpoint.
        :param string interface: Type of endpoint.
                                     Possible values: public or publicURL,
                                     internal or internalURL, admin or
                                     adminURL
        :param string region_name: Region of the endpoint.
        :param string service_name: The assigned name of the service.
        :param string service_id: The identifier of a service.
        :param string endpoint_id: The identifier of an endpoint.

        :returns: tuple of urls or None (if no match found)
        N(tNotImplementedError(RRRRRRR((sY/home/tvault/.virtenv/lib/python2.7/site-packages/keystoneauth1/access/service_catalog.pytget_urlssc	
Cs|jstjdƒ‚n|jd|d|d|d|d|d|ƒ}y|dSWntk
rjnX|r |r d	i|d6|d6|d6|d6}nh|rÈd
i|d6|d6|d6}n@|rðdi|d6|d6|d6}ndi|d6|d6}tj|ƒ‚d
S(sFetch an endpoint from the service catalog.

        Fetch the specified endpoint from the service catalog for
        a particular endpoint attribute. If no attribute is given, return
        the first endpoint of the specified type.

        Valid interface types: `public` or `publicURL`,
                               `internal` or `internalURL`,
                               `admin` or 'adminURL`

        :param string service_type: Service type of the endpoint.
        :param string interface: Type of endpoint.
        :param string region_name: Region of the endpoint.
        :param string service_name: The assigned name of the service.
        :param string service_id: The identifier of a service.
        :param string endpoint_id: The identifier of an endpoint.
        sThe service catalog is empty.RRRRRRisn%(interface)s endpoint for %(service_type)s service named %(service_name)s in %(region_name)s region not foundsT%(interface)s endpoint for %(service_type)s service named %(service_name)s not foundsW%(interface)s endpoint for %(service_type)s service in %(region_name)s region not founds=%(interface)s endpoint for %(service_type)s service not foundN(RRtEmptyCatalogR(t	ExceptiontEndpointNotFound(	RRRRRRRturlstmsg((sY/home/tvault/.virtenv/lib/python2.7/site-packages/keystoneauth1/access/service_catalog.pyturl_for¨s<		




N(t__name__t
__module__t__doc__RRtpropertyRtabctabstractmethodR
tstaticmethodRRtNoneRR%R(R.(((sY/home/tvault/.virtenv/lib/python2.7/site-packages/keystoneauth1/access/service_catalog.pyRs(		

;
tServiceCatalogV2cBsYeZdZed„ƒZed„ƒZd„Zeƒddddddd„ƒZ
RS(szAn object for encapsulating the v2 service catalog.

    The object is created using raw v2 auth token from Keystone.
    cCs5d|krtdƒ‚n||djdiƒƒS(Ntaccesss)Invalid token format for fetching catalogtserviceCatalog(t
ValueErrorR	(tclsttoken((sY/home/tvault/.virtenv/lib/python2.7/site-packages/keystoneauth1/access/service_catalog.pyt
from_tokeníscCs#|rd|kr|d}n|S(NtURL((R((sY/home/tvault/.virtenv/lib/python2.7/site-packages/keystoneauth1/access/service_catalog.pyRôs
cCs
||kS(N((RR
R((sY/home/tvault/.virtenv/lib/python2.7/site-packages/keystoneauth1/access/service_catalog.pyR
ûst	publicURLc	
Cs`|j|ƒ}|jd|d|d|d|d|d|ƒ}tg|D]}||^qIƒS(NRRRRRR(RR%ttuple(	RRRRRRRRR
((sY/home/tvault/.virtenv/lib/python2.7/site-packages/keystoneauth1/access/service_catalog.pyR(þs	N(R/R0R1tclassmethodR=R5RR
RR6R((((sY/home/tvault/.virtenv/lib/python2.7/site-packages/keystoneauth1/access/service_catalog.pyR7çs	tServiceCatalogV3cBsYeZdZed„ƒZed„ƒZd„Zeƒddddddd„ƒZ
RS(szAn object for encapsulating the v3 service catalog.

    The object is created using raw v3 auth token from Keystone.
    cCs5d|krtdƒ‚n||djdiƒƒS(NR<s)Invalid token format for fetching catalogR(R:R	(R;R<((sY/home/tvault/.virtenv/lib/python2.7/site-packages/keystoneauth1/access/service_catalog.pyR=scCs|r|jdƒ}n|S(NR>(trstrip(R((sY/home/tvault/.virtenv/lib/python2.7/site-packages/keystoneauth1/access/service_catalog.pyRscCs+y||dkSWntk
r&tSXdS(NR(RtFalse(RR
R((sY/home/tvault/.virtenv/lib/python2.7/site-packages/keystoneauth1/access/service_catalog.pyR
"s
R?c	
CsQ|jd|d|d|d|d|d|ƒ}tg|D]}|d^q:ƒS(NRRRRRRturl(R%R@(	RRRRRRRRR
((sY/home/tvault/.virtenv/lib/python2.7/site-packages/keystoneauth1/access/service_catalog.pyR((s	N(R/R0R1RAR=R5RR
RR6R((((sY/home/tvault/.virtenv/lib/python2.7/site-packages/keystoneauth1/access/service_catalog.pyRBs	(R3RR t
keystoneauth1Rt
add_metaclasstABCMetatobjectRR7RB(((sY/home/tvault/.virtenv/lib/python2.7/site-packages/keystoneauth1/access/service_catalog.pyt<module>sË'