From a46563b1bfba66118a2a7759dc5e752ac525545a Mon Sep 17 00:00:00 2001 From: m3rlinux Date: Wed, 25 Sep 2024 11:55:23 +0200 Subject: [PATCH] BUG-FIX robotmk.py The XML structure doesn't have the attributes starttime and endtime for status nodes. Instead, it already has elapsed --- checks/robotmk.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/checks/robotmk.py b/checks/robotmk.py index e33b450a..dd9b9924 100644 --- a/checks/robotmk.py +++ b/checks/robotmk.py @@ -553,15 +553,9 @@ def _get_subnodes(self, xmlnode): return subnodes def _get_node_elapsed_time(self): - """Returns the time between given timestamps of a node in seconds.""" - self.start_time = self.xmlnode.find("status").attrib["starttime"] - self.end_time = self.xmlnode.find("status").attrib["endtime"] - if self.start_time == self.end_time or not (self.start_time and self.end_time): - return 0 - start_millis = timestamp_to_millis(self.start_time) - end_millis = timestamp_to_millis(self.end_time) - # start/end_millis can be long but we want to return int when possible - return int(end_millis - start_millis) / float(1000) + """Returns the time elapsed of a node in seconds.""" + self.elapsed = self.xmlnode.find("status").attrib["elapsed"] + return self.elapsed # If the pattern for a WATO matches, return the value (if tuple) or True def _get_pattern_value(self, setting, check_params):