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    
Size: Mime:
ó
±EYc@sßddlZddlZddlZddlZddlmZddlmZddl	m
Z
ddlZddlZddl
mZddl
mZddlmZddlmZdd	lmZdd
lmZddlmZddlmZdd
lmZejeƒZddfZidd6dd6ZddddgZddgZ dZ!dZ"dZ#dZ$dZ%d„Z&d„Z'd„Z(dej)fd „ƒYZ)d!e*fd"„ƒYZ+d#e+fd$„ƒYZ,d%e+fd&„ƒYZ-d'„Z.d(e*fd)„ƒYZ/d*„Z0d+e*fd,„ƒYZ1d-ej2fd.„ƒYZ3d/e3fd0„ƒYZ4d1„Z5d2„Z6d3e7fd4„ƒYZ8ej9e8ƒd5e*fd6„ƒYƒZ:d7ej;j<fd8„ƒYZ=d9ej;j<fd:„ƒYZ>dS(;iÿÿÿÿN(tlog(t	jsonutils(tstrutils(tapi_version_request(tversioned_method(t	exception(ti18n(t_(t_LE(t_LI(tutils(twsgisapplication/jsons&application/vnd.openstack.compute+jsontjsontcreatetdeletetshowtupdatetPOSTtPUTs2.1tversioned_methodssOpenStack-API-VersionsX-OpenStack-Nova-API-Versionsopenstack.legacy_v2cCstS(N(t_SUPPORTED_CONTENT_TYPES(((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pytget_supported_content_typesRscCsttjƒƒS(N(tdictt_MEDIA_TYPE_MAPtitems(((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pyt
get_media_mapVscCs(t|dƒr||St||ƒSdS(Nt__getitem__(thasattrtgetattr(titemtitem_key((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pytitem_get^stRequestcBs×eZdZd„Zdd„Zd„Zd„Zd„Zd„Zd„Z	d	„Z
d
„Zd„Zd„Z
d
„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„ZRS(s@Add some OpenStack API-specific logic to the base webob.Request.cOsNtt|ƒj||Žiid6|_t|dƒsJtjƒ|_ndS(Ntdb_itemsR(tsuperR t__init__t_extension_dataRtapi_versiontAPIVersionRequestR(tselftargstkwargs((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pyR#hstidcCsA|jdj|iƒ}x!|D]}||t||ƒ<q WdS(sAllow API methods to store objects from a DB query to be
        used by API extensions within the same API request.

        An instance of this class only lives for the lifetime of a
        single API request, so there's no need to implement full
        cache management.
        R!N(R$t
setdefaultR(R'tkeyRRR!R((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pytcache_db_itemsns
cCs|jd|S(s Allow an API extension to get previously stored objects within
        the same API request.

        Note that the object data will be slightly stale.
        R!(R$(R'R,((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pytget_db_itemszscCs|j|ƒj|ƒS(s¡Allow an API extension to get a previously stored object
        within the same API request.

        Note that the object data will be slightly stale.
        (R.tget(R'R,R((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pytget_db_item‚scCs|jd|dƒdS(Nt	instancestuuid(R-(R'R1((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pytcache_db_instancesŠscCs|jd|gdƒdS(NR1R2(R-(R'tinstance((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pytcache_db_instancescCs
|jdƒS(NR1(R.(R'((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pytget_db_instancesscCs|jd|ƒS(NR1(R0(R't
instance_uuid((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pytget_db_instance“scCs|jd|dƒdS(Ntflavorstflavorid(R-(R'R9((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pytcache_db_flavors–scCs|jd|gdƒdS(NR9R:(R-(R'tflavor((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pytcache_db_flavor™scCs
|jdƒS(NR9(R.(R'((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pytget_db_flavorsœscCs|jd|ƒS(NR9(R0(R'R:((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pyt
get_db_flavorŸscCs|jd|dƒdS(Nt
compute_nodesR*(R-(R'R@((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pytcache_db_compute_nodes¢scCs|jd|gdƒdS(NR@R*(R-(R'tcompute_node((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pytcache_db_compute_node¥scCs
|jdƒS(NR@(R.(R'((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pytget_db_compute_nodes¨scCs|jd|ƒS(NR@(R0(R'R*((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pytget_db_compute_node«scCs¤d|jkr™d}|jjddƒ}t|ƒdkred|d}|tƒkre|}qen|sƒ|jjtƒƒ}n|pŒd|jd<n|jdS(s.Determine the requested response content-type.snova.best_content_typet.isapplication/sapplication/jsonN(tenvirontNonetpathtrsplittlenRtacceptt
best_match(R'tcontent_typetpartst
possible_type((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pytbest_match_content_type®s	cCs[d|jkrdS|j}|s/|dkr3dS|tƒkrWtjd|ƒ‚n|S(suDetermine content type of the request body.

        Does not do any body introspection, only checks header

        sContent-Types
text/plainRNN(theadersRHRNRRtInvalidContentType(R'RN((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pytget_content_typeÄs	cCs#|js
dS|jjtjƒƒS(sÆDetermine the best available language for the request.

        :returns: the best language match or None if the 'Accept-Language'
                  header was not available in the request.
        N(taccept_languageRHRMRtget_available_languages(R'((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pytbest_match_languageÚs		cCsÜtj|jdddtgƒ}|dkrEtjtjƒ|_n“|dkrctj	ƒ|_nutj|ƒ|_|jj
tjƒtj	ƒƒsØtj
d|jjƒdtjƒjƒdtj	ƒjƒƒ‚ndS(	s@Set API version request based on the request header information.tservice_typetcomputetlegacy_headerstlatesttreq_vertmin_vertmax_verN(tmicroversion_parsetget_versionRRt!LEGACY_API_VERSION_REQUEST_HEADERRHR%R&tDEFAULT_API_VERSIONRtmax_api_versiontmatchestmin_api_versionRtInvalidGlobalAPIVersiont
get_string(R't
hdr_string((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pytset_api_version_requestås"			cCst|jt<dS(N(tTrueRGt
ENV_LEGACY_V2(R'((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pyt
set_legacy_v2scCs|jjttƒS(N(RGR/RktFalse(R'((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pytis_legacy_v2s(t__name__t
__module__t__doc__R#R-R.R0R3R5R6R8R;R=R>R?RARCRDRERQRTRWRiRlRn(((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pyR es.																				tActionDispatchercBs eZdZd„Zd„ZRS(s6Maps method name to local methods through action name.cOs:|jddƒ}t|t|ƒ|jƒ}|||ŽS(sFind and call local method.tactiontdefault(tpopRtstrRt(R'R(R)Rst
action_method((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pytdispatch
scCs
tƒ‚dS(N(tNotImplementedError(R'tdata((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pyRts(RoRpRqRxRt(((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pyRrs	tJSONDeserializercBs&eZd„Zdd„Zd„ZRS(cCsGytj|ƒSWn/tk
rBtdƒ}tjd|ƒ‚nXdS(Nscannot understand JSONtreason(Rtloadst
ValueErrorRRtMalformedRequestBody(R't
datastringtmsg((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pyt
_from_jsons

RtcCs|j|d|ƒS(NRs(Rx(R'R€Rs((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pytdeserializescCsi|j|ƒd6S(Ntbody(R‚(R'R€((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pyRt s(RoRpR‚RƒRt(((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pyR{s	tJSONDictSerializercBs#eZdZdd„Zd„ZRS(s(Default JSON request body serialization.RtcCs|j|d|ƒS(NRs(Rx(R'RzRs((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pyt	serialize'scCstjtj|ƒƒS(N(tsixt	text_typeRtdumps(R'Rz((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pyRt*s(RoRpRqR†Rt(((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pyR…$scs‡fd†}|S(sÆAttaches response code to a method.

    This decorator associates a response code with a method.  Note
    that the function attributes are directly manipulated; the method
    is not wrapped.
    cs
ˆ|_|S(N(t	wsgi_code(tfunc(tcode(sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pyt	decorator6s	((RŒR((RŒsL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pytresponse.stResponseObjectcBs_eZdZddd„Zd„Zd„Zd„Zd„Ze	d„ƒZ
e	d„ƒZRS(	sìBundles a response object

    Object that app methods may return in order to allow its response
    to be modified by extensions in the code. Its use is optional (and
    should only be used if you really know what you are doing).
    cCs:||_d|_||_|p$i|_tƒ|_dS(sBuilds a response object.iÈN(tobjt
_default_codet_codet_headersR…t
serializer(R'RRŒRR((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pyR#Ds
			cCs|j|jƒS(s'Retrieves a header with the given name.(R“tlower(R'R,((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pyRMscCs||j|jƒ<dS(s5Sets a header with the given name to the given value.N(R“R•(R'R,tvalue((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pyt__setitem__RscCs|j|jƒ=dS(s'Deletes the header with the given name.N(R“R•(R'R,((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pyt__delitem__WscCsÓ|j}d}|jdk	r3|j|jƒ}ntjd|ƒ}|jjdƒrwtj	|jdƒ|jd<n|j
|_x3|jj
ƒD]"\}}tj	|ƒ|j|<q“Wtj	|ƒ|jd<|S(sSerializes the wrapped object.

        Utility method for serializing the wrapped object.  Returns a
        webob.Response object.
        R„sContent-LengthsContent-TypeN(R”RHRR†twebobtResponseRRR/R
tutf8RŒt
status_intR“R(R'trequestRNR”R„RŽthdrR–((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pyR†\s	cCs|jp|jS(sRetrieve the response status.(R’R‘(R'((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pyRŒuscCs
|jjƒS(sRetrieve the headers.(R“tcopy(R'((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pyRR{sN(RoRpRqRHR#RR—R˜R†tpropertyRŒRR(((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pyR<s					cCsŒytj|ƒ}Wn/tk
rDtdƒ}tjd|ƒ‚nXt|ƒdkrxtdƒ}tjd|ƒ‚nt|jƒƒdS(sqDetermine action to invoke.

    This looks inside the json body and fetches out the action method
    name.
    scannot understand JSONR|istoo many body keysi(	RR}R~RRRRKtlisttkeys(R„tdecodedR((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pytaction_peek‚s
tResourceExceptionHandlercBs eZdZd„Zd„ZRS(sìContext manager to handle Resource exceptions.

    Used when processing exceptions generated by API implementation
    methods (or their extensions).  Converts most exceptions to Fault
    exceptions, with the appropriate logging.
    cCsdS(N(RH(R'((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pyt	__enter__ scCsR|s
tSt|tjƒr@ttjjd|jƒƒƒ‚nt|tj	ƒrX‚nöt|tj
ƒr”ttjd|jd|jƒƒƒ‚nºt|t
ƒræ|||f}tjtdƒ|d|ƒttjjƒƒ‚nht|tƒrtjtdƒ|ƒ|‚n:t|tjjƒrNtjtdƒ|ƒt|ƒ‚ntS(NtexplanationRŒsException handling resource: %stexc_infosFault thrown: %ssHTTP exception thrown: %s(Rjt
isinstanceRt	ForbiddentFaultR™texct
HTTPForbiddentformat_messagetVersionNotFoundForAPIMethodtInvalidtConvertedExceptionRŒt	TypeErrortLOGterrorRtHTTPBadRequesttinfoR	t
HTTPExceptionRm(R'tex_typetex_valuetex_tracebackR¨((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pyt__exit__£s.		(RoRpRqR¦R»(((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pyR¥˜s	tResourcecBs¡eZdZeZdd„Zd„Zd„Zd„Z	d„Z
d„Zd„Zd„Z
ejjd	eƒd
„ƒZd„Zd„Zd
„Zd„ZRS(s·WSGI app that handles (de)serialization and controller dispatch.

    WSGI app that reads routing information supplied by RoutesMiddleware
    and calls the requested action method upon its controller.  All
    controller action methods must accept a 'req' argument, which is the
    incoming wsgi.Request. If the operation is a PUT or POST, the controller
    method must also accept a 'body' argument (the deserialized request body).
    They may raise a webob.exc exception or return a dict, which will be
    serialized by requested content type.

    Exceptions derived from webob.exc.HTTPException will be automatically
    wrapped in Fault() to provide API friendly error responses.

    cCsY||_tdtƒ|_i|_|r:|j|ƒni|_i|_||_dS(sˆ:param controller: object that implement methods created by routes
                              lib
           :param inherits: another resource object that this resource should
                            inherit extensions from. Any action extensions that
                            are applied to the parent resource will also apply
                            to this resource.
        RN(	t
controllerRR…tdefault_serializerstwsgi_actionstregister_actionstwsgi_extensionstwsgi_action_extensionstinherits(R'R½RÃ((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pyR#Ñs					cCsIt|diƒ}x0|jƒD]"\}}t||ƒ|j|<qWdS(s0Registers controller actions with this resource.R¿N(RRR¿(R'R½tactionsR,tmethod_name((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pyRÀèscCs«t|dgƒ}x’|D]Š\}}t||ƒ}|rp||jkrYg|j|<n|j|j|ƒq||jkrg|j|<n|j|j|ƒqWdS(s3Registers controller extensions with this resource.RÁN(RRÂtappendRÁ(R'R½t
extensionsRÅtaction_namet	extension((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pytregister_extensionsïscCsšt|jdƒr"|jj|ƒSy|ddjƒ}Wntttfk
rWiSXy|d=Wntk
rvnXy|d=Wntk
r•nX|S(s+Parse dictionary created by routes library.tget_action_argsswsgiorg.routing_argsiR½tformat(RR½RËRŸtKeyErrort
IndexErrortAttributeError(R'trequest_environmentR(((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pyRËs

cCs|jƒ}||jfS(N(RTR„(R'RRN((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pytget_bodyscCstƒj|ƒS(N(R{Rƒ(R'R„((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pyRƒ scCsƒx||D]t}d}y,tƒ|d|d||}WdQXWn/tjk
rXqntk
rp}|}nX|r|SqWdS(Ntreqtresp_obj(RHR¥RR¯R«(R'RÇRÓRtaction_argstextRŽtex((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pytprocess_extensions#s


cCs
|jtkS(N(tmethodt_METHODS_WITH_BODY(R'R((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pyt_should_have_body;stRequestClassc	Cs|jr€y|jƒWq€tjk
rK}ttjjd|jƒƒƒStj	k
r|}ttjj
d|jƒƒƒSXn|j|jƒ}|j
ddƒ}y%|j|ƒ\}}|jƒ}Wn6tjk
rtdƒ}ttjjd|ƒƒSX|j||||||ƒS(s@WSGI method that controls (de)serialization and method dispatch.R§RssUnsupported Content-TypeN(tsupport_api_request_versionRiRtInvalidAPIVersionStringR«R™R¬RµR®RftHTTPNotAcceptableRËRGRuRHRÑRQRSRtHTTPUnsupportedMediaTypet_process_stack(	R'RteRÔRsRNR„RLR((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pyt__call__>s&	c
Csüy"|j||||ƒ\}}Wn›ttfk
rKttjjƒƒStk
rŠ}	tdƒ|	j	d}
ttjj
d|
ƒƒStjk
r¿tdƒ}
ttjj
d|
ƒƒSX|rtdƒi|d6t
j|dƒd6t|ƒd	6}
tjtj|
ƒƒntjd
it|ƒd	6ƒyJi}|j|ƒr||jdkrjidd6}q||j|ƒ}nWn6tjk
rµtdƒ}
ttjj
d|
ƒƒSX|j|ƒ|jddƒ}|jjdƒ}
|
r<|r<||
jkr<td
ƒi|d6|
jd6}
ttjj
d|
ƒƒSd}y)tƒ|j|||ƒ}WdQXWntk
r†}	|	}nX|sBd}t|ƒt ks±|dkrÀt!|ƒ}nt"|t!ƒrØ|}n|}|rt#|dƒr|j$|_%n|j&||||ƒ}n|rB|rB|j'||ƒ}qBnt#|dƒrøx9t(|j)j*ƒƒD]"\}}t+j,|ƒ|j)|<qgW|j-j.ƒsød|j-j/ƒ|j)t0<|j-j/ƒ|j)t1<|j)j2dt0ƒ|j)j2dt1ƒqøn|S(sImplement the processing stack.sThere is no such action: %siR§sMalformed request bodys>Action: '%(action)s', calling method: %(meth)s, body: %(body)sRssutf-8R„tmethsCalling method '%(meth)s't
project_idsnova.contextstMalformed request URL: URL's project_id '%(project_id)s' doesn't match Context's project_id '%(context_project_id)s'tcontext_project_idNRŠRRscompute tVary(3t
get_methodRÏR²R«R™R¬tHTTPNotFoundRÍRR(RµRRR‡RˆRvR³tdebugRt
mask_passwordRÚtcontent_lengthRHRƒRRuRGR/RäR¥RxttypeRRR©RRŠR‘R×R†R¡RRRR
R›Rtis_nullRgtAPI_VERSION_REQUEST_HEADERRatadd(R'RRsRÔRNR„RLRãRÇRÖRtcontentsRätcontextRŽt
action_resultRÓRžtval((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pyRàcs‚	
	
	


	
"c	Csb|j||||ƒ\}}|jrX|jj||||ƒ\}}|j|ƒn||fS(N(t_get_methodRÃRçtextend(	R'RRsRNR„RãRÇt_metht
parent_ext((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pyRçÅs		cCsÂy1|jst||ƒ}nt|j|ƒ}Wn4tk
rg|js^|tdgkr‚qnX||jj|gƒfS|dkrœt|ƒ}n|}|j||jj|gƒfS(s6Look up the action-specific method and its extensions.Rs(	R½RRÏR¿t_ROUTES_METHODSRÁR/R¤RÂ(R'RRsRNR„RãRÈ((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pyRôÒs	



cCs?y|d||SWn$tjk
r:ttjjƒƒSXdS(s.Dispatch a call to the action-specific method.RÒN(RR¯R«R™R¬Rè(R'RØRRÔ((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pyRxësN(RoRpRqRmRÜRHR#RÀRÊRËRÑRƒR×RÚR™tdectwsgifyR RâRàRçRôRx(((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pyR¼Às							%	b	
	tResourceV21cBseZeZRS((RoRpRjRÜ(((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pyRû÷scs‡fd†}|S(sÞMark a function as an action.

    The given name will be taken as the action key in the body.

    This is also overloaded to allow extensions to provide
    non-extending definitions of create and delete operations.
    cs
ˆ|_|S(N(twsgi_action(R‹(tname(sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pyRs	((RýR((RýsL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pyRsûs	cs#‡fd†}|r||ŒS|S(sèIndicate a function extends an operation.

    Can be used as either::

        @extends
        def index(...):
            pass

    or as::

        @extends(action='resize')
        def _action_resize(...):
            pass
    cs|jˆjdƒf|_|S(NRs(RoR/twsgi_extends(R‹(R)(sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pyRs((R(R)R((R)sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pytextends
s
tControllerMetaclasscBseZdZd„ZRS(s…Controller metaclass.

    This metaclass automates the task of assembling a dictionary
    mapping action keys to method names.
    c
Cs8i}g}d}xg|D]_}|jt|diƒƒ|jdkrt|jkrxt|tƒ}t|tƒqxqqWxs|jƒD]e\}}	t|	ƒs§q‰nt|	ddƒrÉ|||	j	<q‰t|	ddƒr‰|j
|	jƒq‰q‰W||d<||d<|r||t<ntt
|ƒj||||ƒS(s.Adds the wsgi_actions dictionary to the class.R¿t
ControllerRüRþRÁN(RHRRRotVER_METHOD_ATTRt__dict__tdelattrRtcallableRüRÆRþR"Rt__new__(
tmcsRýtbasestcls_dictRÄRÇRtbaseR,R–((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pyR.s,



(RoRpRqR(((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pyR'sRcBsYeZdZdZdd„Zd„Zedd„ƒZe	d„ƒZ
e	d„ƒZRS(sDefault controller.cCs:|r||_n$|jr-|jƒ|_n	d|_dS(s3Initialize controller with a view builder instance.N(t
_view_buildert_view_builder_classRH(R'tview_builder((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pyR#\s
	cs~‡‡‡fd†‰ytjˆtƒ}Wntk
rKtjˆˆƒSX|rnˆtjˆtƒkrnˆStjˆˆƒS(Ncs¡t|ƒdkr"|dj}n
|dj}ˆjˆ}xL|D]D}|j|j|jƒrCtjˆ|jƒ|jˆ||ŽSqCWt	j
d|ƒ‚dS(sSLook for the method which matches the name supplied and version
            constraints and calls it with the supplied arguments.

            @return: Returns the result of the method called
            @raises: VersionNotFoundForAPIMethod if there is no method which
                 matches the name and version constraints
            iRÒtversionN(RKRRRdt
start_versiontend_versiont	functoolstupdate_wrapperR‹RR¯(R(R)tvert	func_listR‹(R,R'tversion_select(sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pyRgs


(tobjectt__getattribute__RRÏ(R'R,tversion_meth_dict((R,R'RsL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pyRes
cs‡‡‡fd†}|S(sMDecorator for versioning api methods.

        Add the decorator to any method which takes a request object
        as the first parameter and belongs to a class which inherits from
        wsgi.Controller.

        @min_ver: string representing minimum version
        @max_ver: optional string representing maximum version
        cs
tjˆƒ}ˆr'tjˆƒ}ntjƒ}|j}tj||||ƒ}tˆtiƒ}|stˆt|ƒn|j|gƒ}|s¤|||<n|j	|ƒt
j|ƒ}|rðtj
d|jd|jd|jƒ‚n|jdd„dtƒ|S(NRýR]R^R,cSs|jS(N(R(tf((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pyt<lambda>Àstreverse(R%R&RoRtVersionedMethodRRtsetattrR/RÆRtcheck_for_versions_intersectionRtApiVersionsIntersectRýRRtsortRj(Rtobj_min_vertobj_max_vert	func_nametnew_funct	func_dictRtis_intersect(tclsR^R](sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pyRžs.	

				((R'R]R^R((R'R^R]sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pyR%’s&cCs-|o||kstSd„}|||ƒS(NcSs.y|jdƒtSWntk
r)tSXdS(N(R/RHRjRÏRm(td((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pytis_dictËs


(Rm(R„tentity_nameR)((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pyt
is_valid_bodyÆs	cCs›g}d}x@|D]8}|j|jd|fƒ|j|jd|fƒqWd„}|jd|ƒx,|D]$}||d7}|dkrotSqoWtS(sDetermines whether function list contains version intervals
        intersections or not. General algorithm:

        https://en.wikipedia.org/wiki/Intersection_algorithm

        :param func_list: list of VersionedMethod objects
        :return: boolean
        iiiÿÿÿÿcSs|dS(Ni((tx((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pytcompareåsR,(RÆRRR RjRm(RtpairstcounterRR-tp((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pyRÔs

	
N(RoRpRqRHRR#RtclassmethodR%tstaticmethodR+R(((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pyRVs		-3R«cBs‘eZdZidd6dd6dd6dd6d	d
6dd6d
d6dd6d
d6dd6dd6Zd„Zejjdeƒd„ƒZ	d„Z
RS(s>Wrap webob.exc.HTTPException to provide API friendly response.t
badRequestitunauthorizedi‘t	forbiddeni“titemNotFoundi”t	badMethodi•tconflictingRequesti™t	overLimititbadMediaTypeiŸi­tnotImplementediõtserviceUnavailablei÷cCsX||_x<t|jjjƒƒD]"\}}t|ƒ|jj|<q"W|j|_dS(s1Create a Fault for the given webob.exc.exception.N(twrapped_excR¡RRRRvRœ(R'RR,R–((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pyR#s	%RÛcCsy|jƒ}|jj}|jj|dƒ}|jj}tjdi|d6|d6ƒtj	||ƒ}ii|d6|d6|6}|dksœ|dkrÎ|jj
jddƒ}|rÎ|||d	<qÎn|jj
ƒsBd
|jjƒ|jj
t<|jjƒ|jj
t<|jj
jdtƒ|jj
jdtƒnd|j_d
|j_tƒj|ƒ|j_|jS(s?Generate a WSGI response based on the exception passed to ctor.tcomputeFaults+Returning %(code)s to user: %(explanation)sRŒR§tmessageii­sRetry-Aftert
retryAfterscompute Ræsapplication/jsonsUTF-8N(RWR=Rœt_fault_namesR/R§R³RéRt	translateRRRHRRíRgRîRaRïRNtcharsetR…R†ttext(R'RÒtuser_localeRŒt
fault_nameR§t
fault_datatretry((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pyRâ
s2	
cCs
|jjƒS(N(R=t__str__(R'((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pyRI/s(RoRpRqRAR#R™RùRúR RâRI(((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pyR«ós 
	%tRateLimitFaultcBsDeZdZd„Zed„ƒZejjde	ƒd„ƒZ
RS(sRate-limited request response.cCsatj|ƒ}tjjd|ƒ|_ii|jjd6|d6|d6|dd6d6|_dS(	s:Initialize new `RateLimitFault` with relevant information.RRRŒR?tdetailssRetry-AfterR@R9N(RJt_retry_afterR™R¬tHTTPTooManyRequestsR=Rœtcontent(R'R?RKt
retry_timethdrs((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pyR#6s
cCsLttj|tjƒƒƒ}|dkr1|nd}id|d6}|S(Nis%dsRetry-After(tinttmathtceilttime(ROtdelaytretry_afterRR((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pyRLCsRÛcCsœ|jƒ}tj|jdd|ƒ|jdd<tj|jdd|ƒ|jdd<tƒj|jƒ}d|j_d|j_||j_	|jS(sdReturn the wrapped exception with a serialized body conforming
        to our error format.
        R9R?RKsUTF-8sapplication/json(
RWRRBRNR…R†R=RCRNRD(R'RRERN((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pyRâJs(((RoRpRqR#R2RLR™RùRúR Râ(((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pyRJ3s	
(?RRRRTR_toslo_logRtloggingtoslo_serializationRt
oslo_utilsRR‡R™tnova.api.openstackRR%RtnovaRRt	nova.i18nRRR	R
Rt	getLoggerRoR³RRRøRÙRbRRîRaRkRRRR RRrR{R…RŽRR¤R¥tApplicationR¼RûRsRÿRìRt
add_metaclassRR¬R·R«RJ(((sL/home/tvault/.virtenv/lib/python2.7/site-packages/nova/api/openstack/wsgi.pyt<module>sn	
					¢

	F	(ÿ8		/œ@