entropy.client.mirrors.StatusInterface: add two new methods.
Add set_working_mirror and add_failing_working_mirror methods with the aim of increasing the usefulness of the class.
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
class StatusInterface(dict):
|
||||
|
||||
def __init__(self):
|
||||
self.__last_mirrorname = None
|
||||
dict.__init__(self)
|
||||
|
||||
def add_failing_mirror(self, mirrorname, increment = 1):
|
||||
@@ -36,3 +37,14 @@ class StatusInterface(dict):
|
||||
|
||||
def set_failing_mirror_status(self, mirrorname, value):
|
||||
self[mirrorname] = value
|
||||
|
||||
def set_working_mirror(self, mirrorname):
|
||||
self.__last_mirrorname = mirrorname
|
||||
|
||||
def add_failing_working_mirror(self, value):
|
||||
if self.__last_mirrorname:
|
||||
self.add_failing_mirror(self.__last_mirrorname, value)
|
||||
|
||||
def clear(self):
|
||||
self.__last_mirrorname = None
|
||||
return dict.clear(self)
|
||||
Reference in New Issue
Block a user