From 5d0df0bfe9c669bb2ef85d48552fd60dd0f80956 Mon Sep 17 00:00:00 2001 From: Tomas Edwardsson Date: Mon, 20 Jan 2014 11:41:11 +0000 Subject: [PATCH] Check would fail on first run --- check_cpu.py/okplugin_check_cpu | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/check_cpu.py/okplugin_check_cpu b/check_cpu.py/okplugin_check_cpu index 3230c92..1ab9da9 100644 --- a/check_cpu.py/okplugin_check_cpu +++ b/check_cpu.py/okplugin_check_cpu @@ -34,7 +34,10 @@ def main(): stat = get_stat() # Find shortest stat - stat_length = len(old_stat) > len(stat) and len(old_stat) or len(stat) + if old_stat: + stat_length = len(old_stat) > len(stat) and len(old_stat) or len(stat) + else: + stat_length = len(stat) if old_stat: diff = []