Ñò ¾[c@sOddkZddd„ƒYZdefd„ƒYZdefd„ƒYZdS( iÿÿÿÿNtbaseFailOverMethodcBsDeZd„Zdd„Zd„Zdd„Zd„Zd„ZRS(cCs||_d|_dS(Ni(trepotfailures(tselfR((s0/usr/lib/python2.6/site-packages/yum/failover.pyt__init__s cCsdS(sÖReturns a serverurl based on this failover method or None if complete failure. If i is given it is a direct index to pull a server URL from instead of using the failures counter.N(tNone(Rti((s0/usr/lib/python2.6/site-packages/yum/failover.pyt get_serverurlscCs|id|_dS(s<Tells the failover method that the current server is failed.iN(R(R((s0/usr/lib/python2.6/site-packages/yum/failover.pyt server_failed%sicCs ||_dS(s,Reset the failures counter to a given index.N(R(RR((s0/usr/lib/python2.6/site-packages/yum/failover.pytreset)scCs|iS(s Returns the current number of failures which is also the index into the list this object represents. ger_serverurl() should always be used to translate an index into a URL as this object may change how indexs map. (See RoundRobin)(R(R((s0/usr/lib/python2.6/site-packages/yum/failover.pyt get_index-scCst|iiƒS(s5Returns the how many URLs we've got to cycle through.(tlenRturls(R((s0/usr/lib/python2.6/site-packages/yum/failover.pyR 5sN( t__name__t __module__RRRRR R R (((s0/usr/lib/python2.6/site-packages/yum/failover.pyRs      tprioritycBseZdZdd„ZRS(s6Chooses server based on the first success in the list.cCsL|djo |i}n|}|t|iiƒjodS|ii|S(sNReturns a serverurl based on this failover method or None if complete failure.N(RRR RR (RRtindex((s0/usr/lib/python2.6/site-packages/yum/failover.pyR@s   N(R Rt__doc__RR(((s0/usr/lib/python2.6/site-packages/yum/failover.pyR<st roundRobincBs#eZdZd„Zdd„ZRS(s&Chooses server based on a round robin.cCs3ti||ƒtiƒtiddƒ|_dS(Nii%(RRtrandomtseedtrandinttoffset(RR((s0/usr/lib/python2.6/site-packages/yum/failover.pyRSs cCsi|djo |i}n|}|t|iiƒjodS||it|iiƒ}|ii|S(sNReturns a serverurl based on this failover method or None if complete failure.N(RRR RR R(RRRtrr((s0/usr/lib/python2.6/site-packages/yum/failover.pyRXs  N(R RRRRR(((s0/usr/lib/python2.6/site-packages/yum/failover.pyROs ((RRRR(((s0/usr/lib/python2.6/site-packages/yum/failover.pyts $