Module: check_mk
Branch: master
Commit: 613d987c09416ced1506e047e30e61507e5ca5a5
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=613d987c09416c…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Nov 15 16:58:21 2017 +0100
cpu_tracking: Fixed exception when popping the last phase
Change-Id: Ia0ec8e9235fc07e603480da8f0fad959f9090a00
---
lib/cpu_tracking.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/lib/cpu_tracking.py b/lib/cpu_tracking.py
index 2e3b070..1d8a60f 100644
--- a/lib/cpu_tracking.py
+++ b/lib/cpu_tracking.py
@@ -61,7 +61,11 @@ def push_phase(phase):
def pop_phase():
if current_phase != None:
- set_phase(phase_stack[-1])
+ if len(phase_stack) == 1:
+ set_phase(None)
+ else:
+ set_phase(phase_stack[-1])
+
del phase_stack[-1]