/usr/lib/python2.6/site-packages/cinderclient/openstack/common/apiclient
Edit: /usr/lib/python2.6/site-packages/cinderclient/openstack/common/apiclient/client.pyc (12753B)
Ñò
=vVc @ s» d Z d d k Z d d k Z y d d k Z Wn e j
o d d k Z n Xd d k Z d d k l Z d d k l
Z
e i e ƒ Z
d e f d „ ƒ YZ d e f d „ ƒ YZ d S( sC
OpenStack Client interface. Handles the REST calls and responses.
iÿÿÿÿN( t
exceptions( t importutilst
HTTPClientc B sž e Z d Z d Z d d d e d d e d e d d d „ Z d „ Z d „ Z d „ Z
d „ Z d „ Z d „ Z
e d
„ ƒ Z d „ Z d „ Z d
„ Z RS( sË This client handles sending HTTP requests to OpenStack servers.
Features:
- share authentication information between several clients to different
services (e.g., for compute and image clients);
- reissue authentication request for expired tokens;
- encode/decode JSON bodies;
- raise exceptions on HTTP errors;
- pluggable authentication;
- store authentication information in a keyring;
- store time spent for requests;
- register clients for particular services, so one can use
`http_client.identity` or `http_client.compute`;
- log requests and responses in a format that is easy to copy-and-paste
into terminal and send the same request with curl.
s' cinderclient.openstack.common.apiclientt publicURLc
C s™ | | _ | | _ | | _ | | _ | | _ | | _ | | _ | | _ |
| _ | p | i | _ g | _
| | _ | p
t i
ƒ | _ d | _ d S( N( t auth_plugint
endpoint_typet region_namet original_ipt timeoutt verifyt certt
keyring_savert debugt
user_agentt timest timingst requestst Sessiont httpt Nonet cached_token(
t selfR R R R R R
R R R R R
R ( ( s[ /tmp/pip-build-cD3xZi/python-cinderclient/cinderclient/openstack/common/apiclient/client.pyt __init__A s
c C s¤ | i p d Sd d | d | g } x7 | d D]+ } d | | d | f } | i | ƒ q1 Wt i d d i | ƒ ƒ d | j o t i d | d ƒ n d S(
Ns curl -is -X '%s's '%s't headerss -H '%s: %s's REQ: %st t datas
REQ BODY: %s
( R t appendt _loggert join( R t methodt urlt kwargst string_partst elementt header( ( s[ /tmp/pip-build-cD3xZi/python-cinderclient/cinderclient/openstack/common/apiclient/client.pyt
_http_log_reqd s
c C sM | i p d St i d | i | i ƒ | i o t i d | i ƒ n d S( Ns RESP: [%s] %s
s RESP BODY: %s
( R R t status_codeR t _content_consumedt text( R t resp( ( s[ /tmp/pip-build-cD3xZi/python-cinderclient/cinderclient/openstack/common/apiclient/client.pyt _http_log_respv s
c C sd | i d ƒ d j o) d | d d