tests done
This commit is contained in:
@@ -20,13 +20,13 @@ class ConsumerLocator:
|
||||
Manages the list of consumers.
|
||||
"""
|
||||
|
||||
def __init__(self, uuid: str):
|
||||
def __init__(self, uuid: str, communicator: Communicator):
|
||||
"""
|
||||
Initialize class.
|
||||
"""
|
||||
self.consumerlist = [{"Host": os.environ["KnownConsumer"], "State": True, "LastOk": datetime.datetime.now()}]
|
||||
self.currentconsumer = self.consumerlist[0]
|
||||
self.communicator = Communicator(consumerlocator=self,uuid=uuid)
|
||||
self.communicator = communicator
|
||||
|
||||
def learnconsumerlist(self) -> None:
|
||||
""""
|
||||
@@ -82,6 +82,7 @@ class ConsumerLocator:
|
||||
self.learnconsumerlist()
|
||||
|
||||
if self.currentconsumer is not None:
|
||||
self.communicator.set_currentconsumer(self.currentconsumer["Host"])
|
||||
return self.currentconsumer["Host"]
|
||||
else:
|
||||
return None
|
||||
|
||||
Reference in New Issue
Block a user