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

Guannan Ren gren at redhat.com
Mon Apr 23 08:22:02 UTC 2012


    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




More information about the libvir-list mailing list