/usr/lib/python2.6/site-packages/keystoneclient
NameSizeModeActions
apiclient/-0755rm
auth/-0755rm
common/-0755rm
contrib/-0755rm
fixture/-0755rm
generic/-0755rm
hacking/-0755rm
locale/-0755rm
middleware/-0755rm
openstack/-0755rm
tests/-0755rm
v2_0/-0755rm
v3/-0755rm
access.py247750644editdlrm
access.pyc331160644editdlrm
adapter.py84010644editdlrm
adapter.pyc91980644editdlrm
base.py179510644editdlrm
base.pyc207410644editdlrm
baseclient.py13130644editdlrm
baseclient.pyc21330644editdlrm
client.py29130644editdlrm
client.pyc29130644editdlrm
discover.py160230644editdlrm
discover.pyc162010644editdlrm
exceptions.py149840644editdlrm
exceptions.pyc243890644editdlrm
httpclient.py385470644editdlrm
httpclient.pyc332640644editdlrm
i18n.py11620644editdlrm
i18n.pyc5580644editdlrm
service_catalog.py166100644editdlrm
service_catalog.pyc150700644editdlrm
session.py406950644editdlrm
session.pyc358510644editdlrm
shell.py195880644editdlrm
shell.pyc148680644editdlrm
utils.py115890644editdlrm
utils.pyc127330644editdlrm
_discover.py111260644editdlrm
_discover.pyc109290644editdlrm
__init__.py24350644editdlrm
__init__.pyc19940644editdlrm
Edit: /usr/lib/python2.6/site-packages/keystoneclient/discover.pyc (16201B)
Ñò >> from keystoneclient import discover >>> disc = discover.Discovery(auth_url='http://localhost:5000') >>> disc.raw_version_data() [{'id': 'v3.0', 'links': [{'href': u'http://127.0.0.1:5000/v3/', 'rel': u'self'}], 'media-types': [ {'base': 'application/json', 'type': 'application/vnd.openstack.identity-v3+json'}, {'base': 'application/xml', 'type': 'application/vnd.openstack.identity-v3+xml'}], 'status': 'stable', 'updated': '2013-03-06T00:00:00Z'}, {'id': 'v2.0', 'links': [{'href': u'http://127.0.0.1:5000/v2.0/', 'rel': u'self'}, {'href': u'...', 'rel': u'describedby', 'type': u'application/pdf'}], 'media-types': [ {'base': 'application/json', 'type': 'application/vnd.openstack.identity-v2.0+json'}, {'base': 'application/xml', 'type': 'application/vnd.openstack.identity-v2.0+xml'}], 'status': 'stable', 'updated': '2013-03-06T00:00:00Z'}] tallow_experimentalt allow_unknown(t setdefaultRR!RR&(R#R'R((sF/tmp/pip-build-cD3xZi/python-keystoneclient/keystoneclient/discover.pyR&Ðs4cCs’d}|o|i|ƒ}n(|id|ƒ}|o|d}n|p@tdƒ}|otdƒt|ƒ}nti|ƒ‚n|S(NR'iÿÿÿÿs"Could not find a suitable endpoints9Could not find a suitable endpoint for client version: %s(Rtdata_fort version_dataRtstrRtVersionNotAvailable(R#RR'R,t all_versionstmsg((sF/tmp/pip-build-cD3xZi/python-keystoneclient/keystoneclient/discover.pyt_calculate_version s  cKsãyt|dd}WnOtj oCdid„|dDƒƒ}tdƒ|}ti|ƒ‚nXx0ti|iƒD]\}}|i ||ƒq{W|i od|d<|d|d%s s#No client available for version: %sRRR( t_CLIENT_VERSIONStKeyErrortjoinRRRtsixt iteritemsR R*RR(R#R,Rt client_classRR0tkR4((sF/tmp/pip-build-cD3xZi/python-keystoneclient/keystoneclient/discover.pyt_create_client s    cKs"|i||ƒ}|i||S(sFactory function to create a new identity service client. :param tuple version: The required version of the identity API. If specified the client will be selected such that the major version is equivalent and an endpoint provides at least the specified minor version. For example to specify the 3.1 API use (3, 1). (optional) :param bool unstable: Accept endpoints not marked 'stable'. (optional) :param kwargs: Additional arguments will override those provided to this object's constructor. :returns: An instantiated identity client object. :raises keystoneclient.exceptions.DiscoveryFailure: if the server response is invalid :raises keystoneclient.exceptions.VersionNotAvailable: if a suitable client cannot be found. (R1R<(R#RR'RR,((sF/tmp/pip-build-cD3xZi/python-keystoneclient/keystoneclient/discover.pyt create_client8sN(t__name__t __module__t__doc__Rt positionalRR"RtremoveRt removed_kwargRR&R1R<R=(((sF/tmp/pip-build-cD3xZi/python-keystoneclient/keystoneclient/discover.pyRSsD  6  cCstii|||ƒdS(sOAdds a version removal rule for a particular service. Originally deployments of OpenStack would contain a versioned endpoint in the catalog for different services. E.g. an identity service might look like ``http://localhost:5000/v2.0``. This is a problem when we want to use a different version like v3.0 as there is no way to tell where it is located. We cannot simply change all service catalogs either so there must be a way to handle the older style of catalog. This function adds a rule for a given service type that if part of the URL matches a given regular expression in *old* then it will be replaced with the *new* value. This will replace all instances of old with new. It should therefore contain a regex anchor. For example the included rule states:: add_catalog_version_hack('identity', re.compile('/v2.0/?$'), '/') so if the catalog retrieves an *identity* URL that ends with /v2.0 or /v2.0/ then it should replace it simply with / to fix the user's catalog. :param str service_type: The service type as defined in the catalog that the rule will apply to. :param re.RegexObject old: The regular expression to search for and replace if found. :param str new: The new string to replace the pattern with. N(Rt_VERSION_HACKStadd_discover_hack(t service_typetoldtnew((sF/tmp/pip-build-cD3xZi/python-keystoneclient/keystoneclient/discover.pytadd_catalog_discover_hackPs(tloggingRt debtcollectorRR8tkeystoneclientRRtkeystoneclient.i18nRRR Rtkeystoneclient.v2_0Rt v2_clienttkeystoneclient.v3t v3_clientt getLoggerR>t_loggertClientR5RR RRRRI(((sF/tmp/pip-build-cD3xZi/python-keystoneclient/keystoneclient/discover.pyt s$        ý