Classes for handling failovers for server URLs.
A base class to provide a failover to switch to a new server if the current one fails.
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 |
---|
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 |
Return the total number of URLs available to cycle through in this object.
Returns: | the total number of URLs available |
---|
Reset the failures counter to the given index.
Parameters: | i – the index to reset the failures counter to |
---|
Notify the failover method that the current server has failed.
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.
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 |
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.
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 |