mirror of
https://github.com/drewkerrigan/nagios-http-json.git
synced 2025-05-10 01:43:45 +02:00
fix: except for pylint
This commit is contained in:
parent
1fa993ec92
commit
92592943bf
@ -363,11 +363,15 @@ class JsonRuleProcessor:
|
||||
|
||||
try:
|
||||
timestamp = datetime.fromisoformat(self.helper.get(key))
|
||||
except:
|
||||
return " Value (%s) for key %s is not a Date in ISO format." % \
|
||||
(self.helper.get(key), alias)
|
||||
except ValueError as ve:
|
||||
return " Value (%s) for key %s is not a Date in ISO format. %s" % \
|
||||
(self.helper.get(key), alias, ve)
|
||||
|
||||
now = datetime.now(timezone.utc)
|
||||
|
||||
if timestamp.tzinfo == None:
|
||||
timestamp = timestamp.replace(tzinfo=timezone.utc)
|
||||
|
||||
age = now - timestamp
|
||||
|
||||
if not negative:
|
||||
|
Loading…
Reference in New Issue
Block a user