From 25d582cccc6d6c016cf6f1b0345c3bacf08a664c Mon Sep 17 00:00:00 2001 From: schdwlk Date: Sun, 29 Mar 2020 16:48:59 +0200 Subject: [PATCH] Fixed communicator method names in ConsumerLocator --- ConsumerLocator.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ConsumerLocator.py b/ConsumerLocator.py index 410c644..e70816d 100644 --- a/ConsumerLocator.py +++ b/ConsumerLocator.py @@ -1,6 +1,7 @@ #!/usr/bin/env python import datetime +import communicator """ Main Flask RESTful API @@ -29,7 +30,7 @@ class ConsumerLocator: """" Learns the list of consumers. """ - recievedConsumerList = communicator.getConsumerList() + recievedConsumerList = communicator.discoveravailableconsumers() for consumer in recievedConsumerList: self.consumerList.append({"Host": consumer, "State": True, "LastOk": datetime.datetime.now()}) self.updateConsumerList() @@ -40,7 +41,7 @@ class ConsumerLocator: """ removeList = [] for consumer in self.consumerList: - if not communicator.ping(consumer["Host"]): + if not communicator.isconsumeravailable(consumer["Host"]): consumer["State"] = False if datetime.datetime.now() - consumer["LastOk"] > datetime.timedelta(hours=1): removeList.append(consumer) @@ -84,7 +85,7 @@ class ConsumerLocator: Check the consumers health. :return: True if OK, False if fail """ - if communicator.ping(self.currentConsumer["Host"]): + if communicator.isconsumeravailable(self.currentConsumer["Host"]): return True else: return False