yum.failover

Classes for handling failovers for server URLs.

baseFailOverMethod

class yum.failover.baseFailOverMethod(repo)

A base class to provide a failover to switch to a new server if the current one fails.

get_index()

Return the current number of failures, which is also the current index into the list of URLs that this object represents. :fun:`get_serverurl` should always be used to translate an index into a URL, as this object may change how indexes map.

Returns:the current number of failures, which is also the current index
get_serverurl(i=None)

Return a server URL based on this failover method, or None if there is a complete failure. This method should always be used to translate an index into a URL, as this object may change how indexes map.

Parameters:i – if given, this is the index of the server URL to return, instead of using the failures counter
Returns:the next server URL
len()

Return the total number of URLs available to cycle through in this object.

Returns:the total number of URLs available
reset(i=0)

Reset the failures counter to the given index.

Parameters:i – the index to reset the failures counter to
server_failed()

Notify the failover method that the current server has failed.

priority

class yum.failover.priority(repo)

Bases: yum.failover.baseFailOverMethod

A class to provide a failover to switch to a new server if the current one fails. This classes chooses the next server based on the first success in the list of servers.

get_serverurl(i=None)

Return the next successful server URL in the list, or None if there is a complete failure. This method should always be used to translate an index into a URL, as this object may change how indexes map.

Parameters:i – if given, this is the index of the server URL to return, instead of using the failures counter
Returns:the next server URL

roundRobin

class yum.failover.roundRobin(repo)

Bases: yum.failover.baseFailOverMethod

A class to provide a failover to switch to a new server if the current one fails. When an object of this class is created, it selects a random place in the list of URLs to begin with, then each time get_serveurl() is called, the next URL in the list is returned, cycling back to the beginning of the list after the end is reached.

get_serverurl(i=None)

Return the next successful server URL in the list, using the round robin scheme, or None if there is a complete failure. This method should always be used to translate an index into a URL, as this object may change how indexes map.

Parameters:i – if given, this is the index of the server URL to return, instead of using the failures counter
Returns:the next server URL

Table Of Contents

Previous topic

yum.depsolve

Next topic

yum.history

This Page