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@sXddlZddlZddlZddlZddlZddlmZddlmZddlm	Z	ddl
mZeje
ƒZidd6ZdZd	Zd
ZiZdZdefd
„ƒYZdefd„ƒYZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z!dd„Z#dd„Z$dS(iÿÿÿÿN(tstrutils(t
exceptions(tutils(t_t2t1s2.0s3.33s3.0s.'%(other)s' should be an instance of '%(cls)s't
APIVersioncBseZdZdd„Zd„Zd„Zd„ZeZd„Z	d„Z
d„Zd„Zd	„Z
d
„Zd„Zdd„Zd
„ZRS(s¬This class represents an API Version with convenience
    methods for manipulation and comparison of version
    numbers that we need to do to implement microversions.
    cCs¶d|_d|_|dk	r²tjd|ƒ}|rt|jdƒƒ|_|jdƒdkrutdƒ|_q¯t|jdƒƒ|_q²tdƒ|}t	j
|ƒ‚ndS(	sCreate an API version object.is!^([1-9]\d*)\.([1-9]\d*|0|latest)$iitlatesttinfswInvalid format of client version '%s'. Expected format 'X.Y', where X is a major part and Y is a minor part of version.N(t	ver_majort	ver_minortNonetretmatchtinttgrouptfloatRRtUnsupportedVersion(tselftversion_strR
tmsg((sN/home/tvault/.virtenv/lib/python2.7/site-packages/cinderclient/api_versions.pyt__init__.s			cCs+|jƒrd|jSd|j|jfS(s'Debug/Logging representation of object.sLatest API Version Major: %ss API Version Major: %s, Minor: %s(t	is_latestR	R
(R((sN/home/tvault/.virtenv/lib/python2.7/site-packages/cinderclient/api_versions.pyt__str__DscCs|rd|jƒSdS(Ns<APIVersion: %s>s<APIVersion: null>(t
get_string(R((sN/home/tvault/.virtenv/lib/python2.7/site-packages/cinderclient/api_versions.pyt__repr__KscCs|jdkp|jdkS(Ni(R	R
(R((sN/home/tvault/.virtenv/lib/python2.7/site-packages/cinderclient/api_versions.pyt__bool__PscCs|jtdƒkS(NR(R
R(R((sN/home/tvault/.virtenv/lib/python2.7/site-packages/cinderclient/api_versions.pyRUscCsUt|tƒs3tti|d6|jd6ƒ‚n|j|jf|j|jfkS(Ntothertcls(t
isinstanceRt	TypeErrort_type_error_msgt	__class__R	R
(RR((sN/home/tvault/.virtenv/lib/python2.7/site-packages/cinderclient/api_versions.pyt__lt__Xs
cCsUt|tƒs3tti|d6|jd6ƒ‚n|j|jf|j|jfkS(NRR(RRRRR R	R
(RR((sN/home/tvault/.virtenv/lib/python2.7/site-packages/cinderclient/api_versions.pyt__eq__`s
cCsUt|tƒs3tti|d6|jd6ƒ‚n|j|jf|j|jfkS(NRR(RRRRR R	R
(RR((sN/home/tvault/.virtenv/lib/python2.7/site-packages/cinderclient/api_versions.pyt__gt__hs
cCs||kp||kS(N((RR((sN/home/tvault/.virtenv/lib/python2.7/site-packages/cinderclient/api_versions.pyt__le__pscCs|j|ƒS(N(R"(RR((sN/home/tvault/.virtenv/lib/python2.7/site-packages/cinderclient/api_versions.pyt__ne__sscCs||kp||kS(N((RR((sN/home/tvault/.virtenv/lib/python2.7/site-packages/cinderclient/api_versions.pyt__ge__vscCs¡|stdƒ‚nt|tƒr6td|ƒ}nt|tƒrWtd|ƒ}n|ri|ritS|sy||kS|s‰||kS||kož|kSS(säReturns whether the version object represents a version
        greater than or equal to the minimum version and less than
        or equal to the maximum version.

        :param min_version: Minimum acceptable version.
        :param max_version: Maximum acceptable version.
        :returns: boolean

        If min_version is null then there is no minimum limit.
        If max_version is null then there is no maximum limit.
        If self is null then raise ValueError
        s*Null APIVersion doesn't support 'matches'.R(t
ValueErrorRtstrRtTrue(Rtmin_versiontmax_version((sN/home/tvault/.virtenv/lib/python2.7/site-packages/cinderclient/api_versions.pytmatchesys

cCsF|stdƒ‚n|jƒr2d|jdfSd|j|jfS(sƒConverts object to string representation which if used to create
        an APIVersion object results in the same version.
        s.Null APIVersion cannot be converted to string.s%s.%sR(R'RR	R
(R((sN/home/tvault/.virtenv/lib/python2.7/site-packages/cinderclient/api_versions.pyR™s
N(t__name__t
__module__t__doc__RRRRRt__nonzero__RR!R"R#R$R%R&R,R(((sN/home/tvault/.virtenv/lib/python2.7/site-packages/cinderclient/api_versions.pyR(s										 tVersionedMethodcBs#eZd„Zd„Zd„ZRS(cCs(||_||_||_||_dS(sVersioning information for a single method

        :param name: Name of the method
        :param start_version: Minimum acceptable version
        :param end_version: Maximum acceptable_version
        :param func: Method to call

        Minimum and maximums are inclusive
        N(tnamet
start_versiontend_versiontfunc(RR2R3R4R5((sN/home/tvault/.virtenv/lib/python2.7/site-packages/cinderclient/api_versions.pyR¦s
			cCsd|j|j|jfS(Ns#Version Method %s: min: %s, max: %s(R2R3R4(R((sN/home/tvault/.virtenv/lib/python2.7/site-packages/cinderclient/api_versions.pyRµscCsd|jS(Ns<VersionedMethod %s>(R2(R((sN/home/tvault/.virtenv/lib/python2.7/site-packages/cinderclient/api_versions.pyR¹s(R-R.RRR(((sN/home/tvault/.virtenv/lib/python2.7/site-packages/cinderclient/api_versions.pyR1¤s		cCsftjdƒ}tjtjjtƒgƒ}g|D](\}}}|j|ƒr4|d^q4}|S(Nsv[0-9]*$i(	Rtcompiletpkgutiltiter_modulestostpathtdirnamet__file__tsearch(tmatchert
submodulestloaderR2tispkgtavailable_versions((sN/home/tvault/.virtenv/lib/python2.7/site-packages/cinderclient/api_versions.pytget_available_major_versions½s
cCs˜tƒ}|r”t|jƒ|kr”t|ƒdkr[di|jƒd6|dd6}n'di|jƒd6dj|ƒd6}tj|ƒ‚ndS(	sÈChecks major part of ``APIVersion`` obj is supported.

    :raises cinderclient.exceptions.UnsupportedVersion: if major part is not
                                                      supported
    isFInvalid client version '%(version)s'. Major part should be '%(major)s'tversionitmajorsLInvalid client version '%(version)s'. Major part must be one of: '%(major)s's, N(RCR(R	tlenRtjoinRR(tapi_versionRBR((sN/home/tvault/.virtenv/lib/python2.7/site-packages/cinderclient/api_versions.pytcheck_major_versionÈs	

cCsst|ƒ}|tkr=tjdi|d6t|d6ƒntj|ƒrYd|}nt|ƒ}t|ƒ|S(s!Returns checked APIVersion objects^Version %(deprecated_version)s is deprecated, use alternative version %(alternative)s instead.tdeprecated_versiontalternatives%s.0(R(tDEPRECATED_VERSIONStLOGtwarningRtis_int_likeRRI(tversion_stringRH((sN/home/tvault/.virtenv/lib/python2.7/site-packages/cinderclient/api_versions.pytget_api_versionÝs	


cCse|jjƒ}|s%tƒtƒfSx9|D]1}d|jkr,t|jƒt|jƒfSq,WdS(Ns3.(tservicestserver_api_versionRRDR*(tclienttversionsRD((sN/home/tvault/.virtenv/lib/python2.7/site-packages/cinderclient/api_versions.pyt_get_server_version_rangeís
cCst|ƒ\}}|S(sŽQueries the server version info and returns highest supported
    microversion

    :param client: client object
    :returns: APIVersion
    (RV(RTtserver_start_versiontserver_end_version((sN/home/tvault/.virtenv/lib/python2.7/site-packages/cinderclient/api_versions.pytget_highest_version÷scCsut|ƒ\}}|}|rR|rRd}tj|itd6ƒttƒ}nt|||ƒ}t||ƒ|S(süChecks ``requested_version`` and returns the most recent version
    supported by both the API and the client.

    :param client: client object
    :param requested_version: requested version represented by APIVersion obj
    :returns: APIVersion
    sRServer does not support microversions. Changing server version to %(min_version)s.R*(RVRMtdebugtDEPRECATED_VERSIONRt_validate_requested_versiont_validate_server_version(RTtrequested_versionRWRXt
valid_versionR((sN/home/tvault/.virtenv/lib/python2.7/site-packages/cinderclient/api_versions.pytdiscover_versions		
cCs¸|}|j||ƒs´||kr~ttƒ|kru|ttƒkrutdƒ}tj|i|d6|d6ƒn|}q´tjtdƒi|j	ƒd6|j	ƒd6ƒ‚n|S(süValidates the requested version.

    Checks 'requested_version' is within the min/max range supported by the
    server. If 'requested_version' is not within range then attempts to
    downgrade to 'server_end_version'. Otherwise an UnsupportedVersion
    exception is thrown.

    :param requested_version: requestedversion represented by APIVersion obj
    :param server_start_version: APIVersion object representing server min
    :param server_end_version: APIVersion object representing server max
    srRequested version %(requested_version)s is not supported. Downgrading requested version to %(server_end_version)s.R^RXsbThe specified version isn't supported by server. The valid version range is '%(min)s' to '%(max)s'tmintmax(
R,RtMIN_VERSIONtMAX_VERSIONRRMRZRRR(R^RWRXR_R((sN/home/tvault/.virtenv/lib/python2.7/site-packages/cinderclient/api_versions.pyR\s 		
cCs°ttƒ|krVtjtdƒitd6td6|jƒd6|jƒd6ƒ‚nVttƒ|kr¬tjtdƒitd6td6|jƒd6|jƒd6ƒ‚ndS(sEValidates the server version.

    Checks that the 'server_end_version' is greater than the minimum version
    supported by the client. Then checks that the 'server_start_version' is
    less than the maximum version supported by the client.

    :param server_start_version:
    :param server_end_version:
    :return:
    s®Server's version is too old. The client's valid version range is '%(client_min)s' to '%(client_max)s'. The server valid version range is '%(server_min)s' to '%(server_max)s'.t
client_mint
client_maxt
server_mint
server_maxs®Server's version is too new. The client's valid version range is '%(client_min)s' to '%(client_max)s'. The server valid version range is '%(server_min)s' to '%(server_max)s'.N(RRcRRRRdR(RWRX((sN/home/tvault/.virtenv/lib/python2.7/site-packages/cinderclient/api_versions.pyR]Cs 	
	
cCs0|r,|jdkr,d|jƒ|d<ndS(sISet 'OpenStack-API-Version' header if api_version is not
       null
    isvolume sOpenStack-API-VersionN(R
R(theadersRH((sN/home/tvault/.virtenv/lib/python2.7/site-packages/cinderclient/api_versions.pytupdate_headersbscCs+tj|jgƒt|jj|ƒdS(N(t_SUBSTITUTIONSt
setdefaultR2tappend(tversioned_method((sN/home/tvault/.virtenv/lib/python2.7/site-packages/cinderclient/api_versions.pytadd_substitutionkscCsKtj|gƒ}|rGg|D]$}|j|j|jƒr|^qS|S(N(RktgetR,R3R4(t	func_nameRHt
substitutionstm((sN/home/tvault/.virtenv/lib/python2.7/site-packages/cinderclient/api_versions.pytget_substitutionsps

"csJtˆƒ‰ˆr!tˆƒ‰ntdˆjƒ‰‡‡fd†}|S(Ns	%s.latestcs˜t|_tj|ƒ‰tˆˆˆ|ƒ}t|ƒtj|ƒ‡fd†ƒ}t|dƒr”x-|j	D]\}}tj
|||ŽqnWn|S(Ncs^tˆ|jƒ}|s6tj|jjƒˆƒ‚nt|dd„ƒ}|j|||ŽS(NtkeycSs|jS(N(R3(tf((sN/home/tvault/.virtenv/lib/python2.7/site-packages/cinderclient/api_versions.pyt<lambda>Žs(RtRHRtVersionNotFoundForAPIMethodRRbR5(tobjtargstkwargstmethodstmethod(R2(sN/home/tvault/.virtenv/lib/python2.7/site-packages/cinderclient/api_versions.pytsubstitution†st	arguments(R)t	versionedRtget_function_nameR1Rot	functoolstwrapsthasattrRtadd_arg(R5RnR~tcli_argst
cli_kwargs(R4R3(R2sN/home/tvault/.virtenv/lib/python2.7/site-packages/cinderclient/api_versions.pytdecors		
(RR	(R3R4Rˆ((R4R3sN/home/tvault/.virtenv/lib/python2.7/site-packages/cinderclient/api_versions.pyRƒxs(%R‚tloggingR9R7Rt
oslo_utilsRtcinderclientRRtcinderclient._i18nRt	getLoggerR-RMRLR[RdRcRkRtobjectRR1RCRIRQRVRYR`R\R]RjRoRRtRƒ(((sN/home/tvault/.virtenv/lib/python2.7/site-packages/cinderclient/api_versions.pyt<module>s:
|				
			$