mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-21 18:41:03 +00:00
Plugin timesync_status: Handle value 0 correctly
This commit is contained in:
parent
9c995590b2
commit
3e01588570
1 changed files with 4 additions and 0 deletions
|
@ -57,6 +57,10 @@ def parse_time(value):
|
|||
if ' ' in value:
|
||||
return sum(parse_time(x) for x in value.split(' '))
|
||||
|
||||
# If time is exactly zero (for example Jitter), there is no unit (suffix)
|
||||
if value == "0" or value == "-0":
|
||||
return 0
|
||||
|
||||
match = re.match(r'^([+-]?[0-9.]+)([a-z]+)$', value)
|
||||
if not match:
|
||||
raise ValueError('Invalid time ' + value)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue