/usr/lib/python2.6/site-packages/keystoneauth1
Edit: /usr/lib/python2.6/site-packages/keystoneauth1/discover.pyc (12044B)
Ñò
DVc @ sÒ d Z d d k Z d d k l Z d d k l Z e i e ƒ Z e i ƒ d d „ ƒ Z d „ Z d „ Z
d e f d „ ƒ YZ d
e f d „ ƒ YZ e ƒ Z e i d e i d
ƒ d ƒ d „ Z d „ Z d S( sÖ The passive components to version discovery.
The Discover object in discover.py contains functions that can create objects
on your behalf. These functions are not usable from within the keystoneauth1
library because you will get dependency resolution issues.
The Discover object in this file provides the querying components of Discovery.
This includes functions like url_for which allow you to retrieve URLs and the
raw data specified in version discovery responses.
iÿÿÿÿN( t _utils( t
exceptionsc C s h d d 6} | i | d | d | ƒ} y | i ƒ } Wn t j
o nu Xy | d d SWn t t f j
o n Xy | d SWn t j
o n Xy | d g SWn t j
o n Xt | i ƒ d j o | i d d n | i } t i d
| ƒ ‚ d S( s% Retrieve raw version data from a url.s application/jsont Acceptt headerst
authenticatedt versionst valuest versioni2 s ...s0 Invalid Response - Bad version data returned: %sN( t gett jsont
ValueErrort KeyErrort TypeErrort lent textR t DiscoveryFailure( t sessiont urlR R t respt body_respt err_text( ( s= /tmp/pip-build-lt8jXN/keystoneauth1/keystoneauth1/discover.pyt get_version_data! s*
1 c C sÒ y | i d ƒ } Wn t j
o n Xy t | ƒ } Wn t j
o n Xt | ƒ } y t t t | i d ƒ ƒ ƒ SWn t j
o n Xy t t t | ƒ ƒ SWn t j
o n Xt d | ƒ ‚ d S( s+ Turn a version representation into a tuple.t vt .s Invalid version specified: %sN(
t lstript AttributeErrort floatt Exceptiont strt tuplet mapt intt splitR ( R t num( ( s= /tmp/pip-build-lt8jXN/keystoneauth1/keystoneauth1/discover.pyt normalize_version_numberG s$ c C s0 | d | d j o t S| | j o t St S( s× Test that an available version is a suitable match for a required
version.
To be suitable a version must be of the same major version as required
and be at least a match in minor/patch level.
eg. 3.3 is a match for a required 3.1 but 4.1 is not.
:param tuple required: the version that must be met.
:param tuple candidate: the version to test against required.
:returns: True if candidate is suitable False otherwise.
:rtype: bool
i ( t Falset True( t requiredt candidate( ( s= /tmp/pip-build-lt8jXN/keystoneauth1/keystoneauth1/discover.pyt
version_matchh s
t Discoverc B s_ e Z d
Z d Z d Z e i ƒ d
d „ ƒ Z e e
e d „ Z d „ Z d „ Z
d „ Z RS( t stablet currentt supportedt
deprecatedt experimentalc C s t | | d | ƒ| _ d S( NR ( R t _data( t selfR R R ( ( s= /tmp/pip-build-lt8jXN/keystoneauth1/keystoneauth1/discover.pyt __init__‰ s c C sï g } xâ | i D]× } y | d } Wn# t j
o t i d ƒ q n X| i ƒ } | | i j o | i | ƒ q | | i j o | o | i | ƒ qç q | | i j o | o | i | ƒ qç q | o | i | ƒ q q W| S( s_ Get raw version information from URL.
Raw data indicates that only minimal validation processing is performed
on the data, so what is returned here will be the data in the same
format it was received from the endpoint.
:param bool allow_experimental: Allow experimental version endpoints.
:param bool allow_deprecated: Allow deprecated version endpoints.
:param bool allow_unknown: Allow endpoints with an unrecognised status.
:returns: The endpoints returned from the server that match the
criteria.
:rtype: list
t statussC Skipping over invalid version data. No stability status in version.( R. R t _LOGGERt warningt lowert CURRENT_STATUSESt appendt DEPRECATED_STATUSESt EXPERIMENTAL_STATUSES( R/ t allow_experimentalt allow_deprecatedt
allow_unknownR R R1 ( ( s= /tmp/pip-build-lt8jXN/keystoneauth1/keystoneauth1/discover.pyt raw_version_dataŽ s(
c K sT | i | } g } x%| D]} y | d } Wn# t j
o t i d ƒ q n Xy | d } Wn# t j
o t i d ƒ q n Xt | ƒ } xz | D]b } y | d } | d }
Wn) t t f j
o t i d ƒ q n X| i ƒ d j o Pq q Wt i d ƒ q | i h | d
6|
d 6| d d
6ƒ q W| i d d „ ƒ | S( sç Get normalized version data.
Return version data in a structured way.
:returns: A list of version data dictionaries sorted by version number.
Each data element in the returned list is a dictionary
consisting of at least:
:version tuple: The normalized version of the endpoint.
:url str: The url for the endpoint.
:raw_status str: The status as provided by the server
:rtype: list(dict)
t ids* Skipping invalid version data. Missing ID.t linkss, Skipping invalid version data. Missing linkst relt hrefs@ Skipping invalid version link. Missing link URL or relationship.R/ s8 Skipping invalid version data. Missing link to endpoint.R R R1 t
raw_statust keyc S s | d S( R ( ( R ( ( s= /tmp/pip-build-lt8jXN/keystoneauth1/keystoneauth1/discover.pyt
ê s ( R<