/usr/lib/python2.6/site-packages/cinderclient
NameSizeModeActions
openstack/-0755rm
tests/-0755rm
v1/-0755rm
v2/-0755rm
auth_plugin.py45680644editdlrm
auth_plugin.pyc57410644editdlrm
base.py91040644editdlrm
base.pyc81320644editdlrm
client.py207000644editdlrm
client.pyc173680644editdlrm
exceptions.py50490644editdlrm
exceptions.pyc76630644editdlrm
extension.py14090644editdlrm
extension.pyc15300644editdlrm
service_catalog.py35020644editdlrm
service_catalog.pyc25820644editdlrm
shell.py373030644editdlrm
shell.pyc261080644editdlrm
utils.py82250644editdlrm
utils.pyc95060644editdlrm
version.py7260644editdlrm
version.pyc3310644editdlrm
__init__.py9360644editdlrm
__init__.pyc4260644editdlrm
Edit: /usr/lib/python2.6/site-packages/cinderclient/base.pyc (8132B)
Ñò =vVc @sÆdZddkZddkZddkZddkZddkZddklZddkl Z ddkl Z e i Z d„Z de ifd„ƒYZd eieieƒfd „ƒYZdS( sG Base utilities to build API operation managers and objects on top of. iÿÿÿÿN(t exceptions(tbase(tutilscCs&y |iSWntj o|SXdS(s‡ Abstracts the common pattern of allowing both an object or an object's ID as a parameter when dealing with relationships. N(tidtAttributeError(tobj((s>/tmp/pip-build-cD3xZi/python-cinderclient/cinderclient/base.pytgetid$s tManagercBszeZdZd Zd„Zd d d d d„Zeid„ƒZ d„Z d d„Z e d„Z d„Zd d„ZRS( s„ Managers interact with a particular type of API (servers, flavors, images, etc.) and provide CRUD operations for them. cCs ||_dS(N(tapi(tselfR((s>/tmp/pip-build-cD3xZi/python-cinderclient/cinderclient/base.pyt__init__6scCsGd}|djo g}n|o%|iii|d|ƒ\}}n|iii|ƒ\}}|djo |i}n||}t|tƒo(y|d}WqÀtj oqÀXn|i d|ddƒi i ƒzi|i d|ddƒi i ƒz?g} |D]'} | o| ||| dt ƒqq~ } WdQXWdQX|oPt |ƒ}|t|ƒ} | t| ƒjo|| | }|S|| }n || }d} d|jo€|d}|oBx?|D]3}d |jo d |d jo|d } PqÛqÛWn| o"|i| ||d||ƒ}qCn|S( Ntbodytvaluesthuman_idtmodetwtuuidtloadedt volumes_linkstreltnextthref(tNoneRtclienttposttgettresource_classt isinstancetdicttKeyErrortcompletion_cachet__exit__t __enter__tTruetinttlent_list(R turlt response_keyt obj_classR tlimittitemstresptdatat_[1]trest items_newtmarginRRt volumes_link((s>/tmp/pip-build-cD3xZi/python-cinderclient/cinderclient/base.pyR$9sN  %    $$@      ccsqtidddƒ}tiddƒ}tiddƒ}ti|idƒ|idƒƒiƒ}tiitii ||ƒƒ}yti |d ƒWnt j onX|i i ƒ} d | |id d ƒf} tii || ƒ} d |} yt|| t| |ƒƒWntj onXz dVWdt|| dƒ} | o| iƒt|| ƒnXdS(s† The completion cache store items that can be used for bash autocompletion, like UUIDs or human-friendly IDs. A resource listing will clear and repopulate the cache. A resource create will append to the cache. Delete is not handled because listings are assumed to be performed often enough to keep the cache reasonably up-to-date. tCINDERCLIENT_UUID_CACHE_DIRtdefaults~/.cinderclientt OS_USERNAMEtCINDER_USERNAMEtOS_URLt CINDER_URLsutf-8iís %s-%s-cachet_t-s _%s_cacheN(Rtenvthashlibtmd5tencodet hexdigesttostpatht expandusertjointmakedirstOSErrort__name__tlowertreplacetsetattrtopentIOErrortgetattrRtclosetdelattr(R t cache_typeR'Rtbase_dirtusernameR%t uniqifiert cache_dirtresourcetfilenameR?t cache_attrtcache((s>/tmp/pip-build-cD3xZi/python-cinderclient/cinderclient/base.pyRqs2  !   cCs6t|d|dƒ}|o|id|ƒndS(Ns _%s_caches%s (RJRtwrite(R RMtvalRU((s>/tmp/pip-build-cD3xZi/python-cinderclient/cinderclient/base.pytwrite_to_completion_cache§scCsW|iii|ƒ\}}|o|i|||dtƒS|i||dtƒSdS(NR(RRRRR!(R R%R&R*R ((s>/tmp/pip-build-cD3xZi/python-cinderclient/cinderclient/base.pyt_get¬sc Ks¶|id|||iii|d|ƒ\}}|o ||S|id|iddƒiiƒzE|id|iddƒiiƒz|i|||ƒSWdQXWdQXdS(Ntmodify_body_for_createR R RtaR(t run_hooksRRRRRRR (R R%R R&t return_rawtkwargsR*((s>/tmp/pip-build-cD3xZi/python-cinderclient/cinderclient/base.pyt_create³s! ''cCs|iii|ƒ\}}dS(N(RRtdelete(R R%R*R ((s>/tmp/pip-build-cD3xZi/python-cinderclient/cinderclient/base.pyt_delete½scKsZ|id|||iii|d|ƒ\}}|o|i|||dtƒS|S(Ntmodify_body_for_updateR R(R\RRtputRR!(R R%R R&R^R*((s>/tmp/pip-build-cD3xZi/python-cinderclient/cinderclient/base.pyt_updateÀs !N(RDt __module__t__doc__RRR R$t contextlibtcontextmanagerRRXRYtFalseR_RaRd(((s>/tmp/pip-build-cD3xZi/python-cinderclient/cinderclient/base.pyR/s 76   tManagerWithFindcBs2eZdZeid„ƒZd„Zd„ZRS(sM Like a `Manager`, but with additional `find()`/`findall()` methods. cCsdS(N((R ((s>/tmp/pip-build-cD3xZi/python-cinderclient/cinderclient/base.pytlistÍscKsz|i|}t|ƒ}|djo,d|ii|f}tid|ƒ‚n#|djo ti‚n |dSdS(s Find a single item with attributes matching ``**kwargs``. This isn't very efficient for search options which require the Python side filtering(e.g. 'human_id') isNo %s matching %s.i”iN(tfindallR#RRDRtNotFoundt NoUniqueMatch(R R^tmatchest num_matchestmsg((s>/tmp/pip-build-cD3xZi/python-cinderclient/cinderclient/base.pytfindÑs    c sÉhdd6}d|jo|d|d/tmp/pip-build-cD3xZi/python-cinderclient/cinderclient/base.pys þs (R)RktalltappendR(R R^Rvtfoundtsearches((Rs>/tmp/pip-build-cD3xZi/python-cinderclient/cinderclient/base.pyRlâs     (RDReRftabctabstractmethodRkRrRl(((s>/tmp/pip-build-cD3xZi/python-cinderclient/cinderclient/base.pyRjÈs (RfR~RgR:R>tsixt cinderclientRt'cinderclient.openstack.common.apiclientRt common_baseRtResourceRt HookableMixinRtwith_metaclasstABCMetaRj(((s>/tmp/pip-build-cD3xZi/python-cinderclient/cinderclient/base.pyts       ™