[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [test-API PATCH] Fix a bug in the case that clean flag is used



    When clean flag is used in testcase, the framework
    reports 'KeyError'.
    The bug is caused is by getting mod_case earlier
    than checking whether the 'clean' flag is present or not.
    The testcases without flag set doesn't be affected.
---
 src/generator.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/generator.py b/src/generator.py
index 6a46889..2e4ae07 100644
--- a/src/generator.py
+++ b/src/generator.py
@@ -115,11 +115,11 @@ class FuncGen(object):
             clean_flag = False
 
             mod_case_func = self.case_name_list[i]
-            mod_case = mod_case_func.rsplit(":", 1)[0]
             if mod_case_func.endswith(':clean'):
                 mod_case_func = mod_case_func[:-6]
                 clean_flag = True
 
+            mod_case = mod_case_func.rsplit(":", 1)[0]
             self.fmt.print_start(mod_case, env_logger)
 
             case_params = self.case_params_list[i]
-- 
1.7.7.5


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]