From 8ab91133c7789960d7404c95a6c875f51c365ee4 Mon Sep 17 00:00:00 2001 From: Lou Berger Date: Tue, 23 Jan 2018 08:10:50 -0500 Subject: [PATCH] lib: ltemplate - fix handling of CallOnFail (take 2) Signed-off-by: Lou Berger --- tests/topotests/lib/ltemplate.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/topotests/lib/ltemplate.py b/tests/topotests/lib/ltemplate.py index e1d7750a07..c112235fc0 100644 --- a/tests/topotests/lib/ltemplate.py +++ b/tests/topotests/lib/ltemplate.py @@ -122,7 +122,9 @@ def ltemplateTest(script, SkipIfFailed=True, CallOnFail=None, CheckFuncStr=None) if check != True: pytest.skip("Check function '"+CheckFuncStr+"' returned: " + check) - luInclude(script, eval(CallOnFail)) + if CallOnFail != None: + CallOnFail = eval(CallOnFail) + luInclude(script, CallOnFail) numFail = luNumFail() - numEntry if numFail > 0: luShowFail() -- 2.39.5