[PATCH] [TEST] #2 Update test cases to follow the new coding style

# HG changeset patch # User Guolian Yun <yunguol@cn.ibm.com> # Date 1233914079 28800 # Node ID 263e285881acde9b99849cd133399298219c9d65 # Parent 3fc2b8a203339c6a59b5f0e2a159e3e0a802ea6d [TEST] #2 Update test cases to follow the new coding style Updates from 1 to 2: 1) fix the logger() call on line 62 in ElementCapabilities/05_hostsystem_cap.py 2) fix fix the logger() call on line 73 in HostSystem/04_hs_to_EAPF.py 1) Use commas instead of percent signs when passing parameters to logger.error() and logger.info() 2) Use percents When passing parameters to Exception() Tested for KVM/LXC with current sources Signed-off-by: Guolian Yun<yunguol@cn.ibm.com> diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/AllocationCapabilities/01_enum.py --- a/suites/libvirt-cim/cimtest/AllocationCapabilities/01_enum.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/AllocationCapabilities/01_enum.py Fri Feb 06 01:54:39 2009 -0800 @@ -76,13 +76,13 @@ for inst in ac: id = inst.InstanceID if pools[id].ResourceType != inst.ResourceType: - logger.error("%s ResourceType %s, Pool ResourceType %s" % (cn, - inst.ResourceType, pools[id].ResourceType)) + logger.error("%s ResourceType %s, Pool ResourceType %s", + cn, inst.ResourceType, pools[id].ResourceType) return FAIL except Exception, details: - logger.error("%s returned instance with unexpected InstanceID %s" % (cn, - details)) + logger.error("%s returned instance with unexpected InstanceID %s", + cn, details) return FAIL return PASS @@ -106,7 +106,7 @@ return status if len(ac) != len(pools): - logger.error("%d %s insts != %d pool insts" % (len(ac), cn, len(pools))) + logger.error("%d %s insts != %d pool insts", len(ac), cn, len(pools)) return FAIL status = compare_pool_to_ac(ac, pools, cn) diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/AllocationCapabilities/02_alloccap_gi_errs.py --- a/suites/libvirt-cim/cimtest/AllocationCapabilities/02_alloccap_gi_errs.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/AllocationCapabilities/02_alloccap_gi_errs.py Fri Feb 06 01:54:39 2009 -0800 @@ -62,7 +62,7 @@ for ac in enum_list: pool, id, status = parse_instance_id(ac.InstanceID) if status != PASS: - logger.error("Unable to parse InstanceID: %s" % ac.InstanceID) + logger.error("Unable to parse InstanceID: %s", ac.InstanceID) return ac_ids, FAIL ac_ids.append("%s/invalid_id" % pool) diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/ComputerSystem/01_enum.py --- a/suites/libvirt-cim/cimtest/ComputerSystem/01_enum.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/ComputerSystem/01_enum.py Fri Feb 06 01:54:39 2009 -0800 @@ -49,12 +49,12 @@ del live_cs[idx] except ValueError, detail: Globals.logger.error("Provider reports system `%s', \ -but virsh does not" % name) +but virsh does not", name) status = FAIL for system in live_cs: Globals.logger.error("Provider does not report system `%s', \ -but virsh does" % system) +but virsh does", system) status = FAIL except IndexError, detail: diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/ComputerSystem/02_nosystems.py --- a/suites/libvirt-cim/cimtest/ComputerSystem/02_nosystems.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/ComputerSystem/02_nosystems.py Fri Feb 06 01:54:39 2009 -0800 @@ -60,7 +60,7 @@ return FAIL if len(cs) != 0: - logger.error("%s returned %d instead of empty list" % (cn, len(cs))) + logger.error("%s returned %d instead of empty list", cn, len(cs)) status = FAIL else: status = PASS diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/ComputerSystem/03_defineVS.py --- a/suites/libvirt-cim/cimtest/ComputerSystem/03_defineVS.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/ComputerSystem/03_defineVS.py Fri Feb 06 01:54:39 2009 -0800 @@ -46,7 +46,7 @@ cxml = vxml.get_class(options.virt)(test_dom) rc = cxml.cim_define(options.ip) if not rc: - Globals.logger.error(VIRSH_ERROR_DEFINE % test_dom) + Globals.logger.error(VIRSH_ERROR_DEFINE, test_dom) return status cs_class = get_typed_class(options.virt, 'ComputerSystem') @@ -74,7 +74,7 @@ Globals.logger.error("Exception: %s", detail) if status != PASS : - Globals.logger.error("Error: property values are not set for VS %s" % test_dom) + Globals.logger.error("Error: property values are not set for VS %s", test_dom) cxml.undefine(options.ip) return status diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/ComputerSystem/04_defineStartVS.py --- a/suites/libvirt-cim/cimtest/ComputerSystem/04_defineStartVS.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/ComputerSystem/04_defineStartVS.py Fri Feb 06 01:54:39 2009 -0800 @@ -47,12 +47,12 @@ try: ret = cxml.cim_define(options.ip) if not ret: - logger.error("Unable to define %s" % test_dom) + logger.error("Unable to define %s", test_dom) return FAIL status = cxml.cim_start(options.ip) if status != PASS: - logger.error("Failed to Start the dom: %s" % test_dom) + logger.error("Failed to Start the dom: %s", test_dom) logger.error("Property values not set properly for %s", test_dom) except Exception, detail: diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/ComputerSystem/05_activate_defined_start.py --- a/suites/libvirt-cim/cimtest/ComputerSystem/05_activate_defined_start.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/ComputerSystem/05_activate_defined_start.py Fri Feb 06 01:54:39 2009 -0800 @@ -70,7 +70,7 @@ raise Exception("%s not in expected state" % test_dom) except Exception, detail: - logger.error("Exception: %s" % detail) + logger.error("Exception: %s", detail) status = FAIL cxml.cim_destroy(options.ip) diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/ComputerSystem/06_paused_active_suspend.py --- a/suites/libvirt-cim/cimtest/ComputerSystem/06_paused_active_suspend.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/ComputerSystem/06_paused_active_suspend.py Fri Feb 06 01:54:39 2009 -0800 @@ -77,7 +77,7 @@ raise Exception("%s not in expected state" % test_dom) except Exception, detail: - logger.error("Exception variable: %s" % detail) + logger.error("Exception variable: %s", detail) status = FAIL cxml.destroy(server) diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/ComputerSystem/22_define_suspend.py --- a/suites/libvirt-cim/cimtest/ComputerSystem/22_define_suspend.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/ComputerSystem/22_define_suspend.py Fri Feb 06 01:54:39 2009 -0800 @@ -53,14 +53,14 @@ # suspend the vs status = cxml.cim_suspend(options.ip) if status != PASS: - logger.info("Suspending defined %s failed, as expected" % test_dom) + logger.info("Suspending defined %s failed, as expected", test_dom) status = PASS else: raise Exception("Suspending defined %s should have failed" % \ test_dom) except Exception, detail: - logger.error("Error: %s" % detail) + logger.error("Error: %s", detail) status = FAIL cxml.undefine(options.ip) diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/ComputerSystem/41_cs_to_settingdefinestate.py --- a/suites/libvirt-cim/cimtest/ComputerSystem/41_cs_to_settingdefinestate.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/ComputerSystem/41_cs_to_settingdefinestate.py Fri Feb 06 01:54:39 2009 -0800 @@ -121,7 +121,7 @@ for rasd in rasd_list: guest, dev, status = parse_instance_id(rasd.InstanceID) if status != PASS: - logger.error("Unable to parse InstanceID: %s" % rasd.InstanceID) + logger.error("Unable to parse InstanceID: %s", rasd.InstanceID) return rasd_insts, FAIL if guest == test_dom: @@ -272,7 +272,7 @@ status, cs_assoc_info = get_associators_info(server, cn, an, cs_class, instid) if status != PASS: - raise Exception("Failed to get assoc info for dom: %s", test_dom) + raise Exception("Failed to get assoc info for dom: %s" % test_dom) # verify the results of SettingsDefineState with the cs_values list # that was built using the output of the GetInstance on ComputerSystem. diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/ComputerSystemIndication/01_created_indication.py --- a/suites/libvirt-cim/cimtest/ComputerSystemIndication/01_created_indication.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/ComputerSystemIndication/01_created_indication.py Fri Feb 06 01:54:39 2009 -0800 @@ -58,7 +58,7 @@ dict['default_sysname'], port) sub.subscribe(dict['default_url'], dict['default_auth']) - logger.info("Watching for %s" % iname) + logger.info("Watching for %s", iname) ind_names[ind] = ind_name sub_list[ind] = sub @@ -98,12 +98,12 @@ if str(sub.server.indications[0]) == ind_name: sub.unsubscribe(dict['default_auth']) - logger.info("Cancelling subscription for %s" % ind_name) + logger.info("Cancelling subscription for %s", ind_name) return PASS else: sub.server.indications.remove(sub.server.indications[0]) - logger.error("Did not recieve indication %s" % ind_name) + logger.error("Did not recieve indication %s", ind_name) return FAIL def poll_for_ind(pid, ind_name): @@ -129,7 +129,7 @@ logger.error("Waited too long for %s indication", ind_name) kill(pid, SIGKILL) else: - logger.error("Received indication error: %d" % pw[1]) + logger.error("Received indication error: %d", pw[1]) status = FAIL break @@ -174,13 +174,13 @@ raise Exception(details) except Exception, details: - logger.error("Exception: %s" % details) + logger.error("Exception: %s", details) status = FAIL #Make sure all subscriptions are really unsubscribed for ind, sub in sub_list.iteritems(): sub.unsubscribe(dict['default_auth']) - logger.info("Cancelling subscription for %s" % ind_names[ind]) + logger.info("Cancelling subscription for %s", ind_names[ind]) cxml.undefine(ip) diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/ElementAllocatedFromPool/01_forward.py --- a/suites/libvirt-cim/cimtest/ElementAllocatedFromPool/01_forward.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/ElementAllocatedFromPool/01_forward.py Fri Feb 06 01:54:39 2009 -0800 @@ -67,11 +67,11 @@ inst = GetInstance(server, cn_name, key_list) except Exception, details: - logger.error("Exception %s" % details) + logger.error("Exception %s", details) return None if inst is None: - logger.error("Expected at least one %s instance" % cn_name) + logger.error("Expected at least one %s instance", cn_name) return None return inst diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/ElementCapabilities/01_forward.py --- a/suites/libvirt-cim/cimtest/ElementCapabilities/01_forward.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/ElementCapabilities/01_forward.py Fri Feb 06 01:54:39 2009 -0800 @@ -130,7 +130,7 @@ elec = assoc.AssociatorNames(server, an, ccn, Name = system, CreationClassName = ccn) except Exception: - logger.error(CIM_ERROR_ASSOCIATORNAMES % system) + logger.error(CIM_ERROR_ASSOCIATORNAMES, system) cxml.undefine(server) return FAIL diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/ElementCapabilities/02_reverse.py --- a/suites/libvirt-cim/cimtest/ElementCapabilities/02_reverse.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/ElementCapabilities/02_reverse.py Fri Feb 06 01:54:39 2009 -0800 @@ -57,7 +57,7 @@ def filter(list, cn, exp_result): new_list = assoc.filter_by_result_class(list, cn) if len(new_list) != exp_result: - logger.error("Expected %d host, got %d" % (exp_result, len(new_list))) + logger.error("Expected %d host, got %d", exp_result, len(new_list)) return FAIL, new_list return PASS, new_list @@ -154,7 +154,7 @@ cxml = virtxml(test_dom) ret = cxml.cim_define(options.ip) if not ret: - logger.error("Failed to define the dom: %s" % test_dom) + logger.error("Failed to define the dom: %s", test_dom) return FAIL cs = domain_list(options.ip, options.virt) diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/ElementCapabilities/03_forward_errs.py --- a/suites/libvirt-cim/cimtest/ElementCapabilities/03_forward_errs.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/ElementCapabilities/03_forward_errs.py Fri Feb 06 01:54:39 2009 -0800 @@ -51,14 +51,14 @@ logger.info("Got expected rc code and error string") status = PASS else: - logger.error("Unexpected rc code %s and description %s\n" %(rc, desc)) + logger.error("Unexpected rc code %s and description %s\n", rc, desc) except Exception, details: logger.error("Unknown exception happened") logger.error(details) if rc == 0: logger.error("ElementCapabilities associator should NOT return excepted \ - result with a wrong key name and value of %s input" % ref_class) + result with a wrong key name and value of %s input", ref_class) status = FAIL return status diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/ElementCapabilities/04_reverse_errs.py --- a/suites/libvirt-cim/cimtest/ElementCapabilities/04_reverse_errs.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/ElementCapabilities/04_reverse_errs.py Fri Feb 06 01:54:39 2009 -0800 @@ -50,14 +50,14 @@ logger.info("Got expected rc code and error string") status = PASS else: - logger.error("Unexpected rc code %s and description %s\n" %(rc, desc)) + logger.error("Unexpected rc code %s and description %s\n", rc, desc) except Exception, details: logger.error("Unknown exception happened") logger.error(details) if rc == 0: logger.error("ElementCapabilities associator should NOT return excepted result \ - with a wrong key name and value of %s input" % ref_class) + with a wrong key name and value of %s input", ref_class) status = FAIL return status diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/ElementCapabilities/05_hostsystem_cap.py --- a/suites/libvirt-cim/cimtest/ElementCapabilities/05_hostsystem_cap.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/ElementCapabilities/05_hostsystem_cap.py Fri Feb 06 01:54:39 2009 -0800 @@ -59,7 +59,7 @@ sup_types = ['Xen', 'XenFV', 'KVM', 'LXC'] def print_err(err, detail, cn): - logger.error(err % cn) + logger.error(err, cn) logger.error("Exception: %s", detail) def field_err(fieldname, exp_val, ret_value): @@ -76,7 +76,7 @@ break if ret != PASS: - logger.error("%s with %s was not returned" % (cn, exp_val)) + logger.error("%s with %s was not returned", cn, exp_val) status = FAIL return status, inst diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/ElementConforms/01_forward.py --- a/suites/libvirt-cim/cimtest/ElementConforms/01_forward.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/ElementConforms/01_forward.py Fri Feb 06 01:54:39 2009 -0800 @@ -151,13 +151,13 @@ cxml = virt_xml(test_dom) ret = cxml.cim_define(server) if not ret: - logger.error('Unable to define domain %s' % test_dom) + logger.error('Unable to define domain %s', test_dom) return FAIL ret = cxml.start(server) if not ret: cxml.undefine(server) - logger.error('Unable to start domain %s' % test_dom) + logger.error('Unable to start domain %s', test_dom) return FAIL prev_namespace = Globals.CIM_NS @@ -201,7 +201,7 @@ raise Exception("%s items weren't returned: %s" % (key, list)) except Exception, detail: - logger.error("Exception: %s" % detail) + logger.error("Exception: %s", detail) status = FAIL Globals.CIM_NS = prev_namespace diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/ElementConforms/02_reverse.py --- a/suites/libvirt-cim/cimtest/ElementConforms/02_reverse.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/ElementConforms/02_reverse.py Fri Feb 06 01:54:39 2009 -0800 @@ -93,7 +93,7 @@ ret = cxml.cim_define(server) if not ret: - logger.error("ERROR: Failed to Define the dom: %s" % test_dom) + logger.error("ERROR: Failed to Define the dom: %s", test_dom) return status inst_list = {} @@ -102,7 +102,7 @@ if rc != 0: cs = libvirt_cached_data_poll(server, virt, test_dom) if sys is None: - logger.error("Instance for %s not created" % test_dom) + logger.error("Instance for %s not created", test_dom) cxml.undefine(server) return FAIL @@ -116,7 +116,7 @@ return status except Exception, details: - logger.error("DEBUG Exception: %s" % details) + logger.error("DEBUG Exception: %s", details) cxml.undefine(server) return FAIL diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/ElementConforms/03_ectp_fwd_errs.py --- a/suites/libvirt-cim/cimtest/ElementConforms/03_ectp_fwd_errs.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/ElementConforms/03_ectp_fwd_errs.py Fri Feb 06 01:54:39 2009 -0800 @@ -84,7 +84,7 @@ ret_val = try_assoc(conn, classname, ac_classname, keys, field_name=field, \ expr_values=expr_values[field], bug_no="") if ret_val != PASS: - logger.error("------ FAILED: %s------" % field) + logger.error("------ FAILED: %s------", field) name_val[i] = temp return ret_val diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/ElementConforms/04_ectp_rev_errs.py --- a/suites/libvirt-cim/cimtest/ElementConforms/04_ectp_rev_errs.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/ElementConforms/04_ectp_rev_errs.py Fri Feb 06 01:54:39 2009 -0800 @@ -125,7 +125,7 @@ ret_val = try_assoc(conn, classname, ac_classname, keys, field_name=field, \ expr_values=expr_values[field], bug_no="") if ret_val != PASS: - logger.error("------ FAILED: %s------" % field) + logger.error("------ FAILED: %s------", field) name_val[i] = temp return ret_val @@ -142,7 +142,7 @@ cxml = virt_xml(test_dom) ret = cxml.cim_define(options.ip) if not ret: - logger.error('Unable to define domain %s' % test_dom) + logger.error('Unable to define domain %s', test_dom) return FAIL hs = get_typed_class(options.virt, "HostSystem") diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/ElementSettingData/01_forward.py --- a/suites/libvirt-cim/cimtest/ElementSettingData/01_forward.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/ElementSettingData/01_forward.py Fri Feb 06 01:54:39 2009 -0800 @@ -72,11 +72,11 @@ inst = GetInstance(ip, cn, key_list) except Exception, details: - logger.error("Exception %s" % details) + logger.error("Exception %s", details) return None if inst is None: - logger.error("Expected at least one %s instance" % cn) + logger.error("Expected at least one %s instance", cn) return None return inst @@ -167,7 +167,7 @@ for cn, inst in inst_list.iteritems(): status = test_assoc(options.ip, esd_cn, cn, options.virt, inst) if status != PASS: - logger.error("Unable to get %s insts from %s" % (cn, esd_cn)) + logger.error("Unable to get %s insts from %s", cn, esd_cn) break cxml.undefine(options.ip) diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/ElementSettingData/03_esd_assoc_with_rasd_errs.py --- a/suites/libvirt-cim/cimtest/ElementSettingData/03_esd_assoc_with_rasd_errs.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/ElementSettingData/03_esd_assoc_with_rasd_errs.py Fri Feb 06 01:54:39 2009 -0800 @@ -88,7 +88,7 @@ cxml = virtxml(test_dom, mac = test_mac) ret = cxml.create(options.ip) if not ret: - logger.error("Failed to Create the dom: %s" % test_dom) + logger.error("Failed to Create the dom: %s", test_dom) status = FAIL return status if options.virt == "XenFV": diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/HostSystem/01_enum.py --- a/suites/libvirt-cim/cimtest/HostSystem/01_enum.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/HostSystem/01_enum.py Fri Feb 06 01:54:39 2009 -0800 @@ -50,7 +50,7 @@ try: hs = enumclass.EnumInstances(options.ip, name) except Exception, details: - logger.error("%s %s: %s" % (CIM_ERROR_ENUMERATE, name, details)) + logger.error("%s %s: %s", CIM_ERROR_ENUMERATE, name, details) status = FAIL if ret == PASS: @@ -60,25 +60,25 @@ else: if linux_cs.CreationClassName != 'Linux_ComputerSystem'\ or linux_cs.Name != host: - logger.error("Exp Linux_ComputerSystem, got %s" \ - % linux_cs.CreationClassName) - logger.error("Exp %s, got %s" % (host, system.Name)) + logger.error("Exp Linux_ComputerSystem, got %s", + linux_cs.CreationClassName) + logger.error("Exp %s, got %s", host, system.Name) return FAIL else: return PASS else: if len(hs) != 1: - logger.error("Expected 1 %s instance returned" % name) + logger.error("Expected 1 %s instance returned", name) return FAIL system = hs[0] if system.CreationClassName != name or system.Name != host: - logger.error("Exp %s, got %s" % (name, system.CreationClassName)) - logger.error("Exp %s, got %s" % (host, system.Name)) + logger.error("Exp %s, got %s", name, system.CreationClassName) + logger.error("Exp %s, got %s", host, system.Name) status = FAIL else: - logger.info("%s is %s" % (name, host)) + logger.info("%s is %s", name, host) status = PASS return status diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/HostSystem/02_hostsystem_to_rasd.py --- a/suites/libvirt-cim/cimtest/HostSystem/02_hostsystem_to_rasd.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/HostSystem/02_hostsystem_to_rasd.py Fri Feb 06 01:54:39 2009 -0800 @@ -96,7 +96,7 @@ return status, vsxml_info def print_err(err, detail, cn): - logger.error(err % cn) + logger.error(err, cn) logger.error("Exception: %s", detail) def get_inst_from_list(server, cn, cs_list, filter_name, exp_val, vsxml): @@ -109,7 +109,7 @@ break if ret != PASS: - logger.error("%s with %s was not returned" % (cn, exp_val)) + logger.error("%s with %s was not returned", cn, exp_val) vsxml.undefine(server) status = FAIL @@ -165,7 +165,7 @@ SystemCreationClassName = sccn) if len(assoc_info) != 1: - logger.error("%s returned %i %s objects" % (an, len(assoc_info), cn)) + logger.error("%s returned %i %s objects", an, len(assoc_info), cn) status = FAIL break index = (len(assoc_info) - 1) diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/HostSystem/03_hs_to_settdefcap.py --- a/suites/libvirt-cim/cimtest/HostSystem/03_hs_to_settdefcap.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/HostSystem/03_hs_to_settdefcap.py Fri Feb 06 01:54:39 2009 -0800 @@ -73,7 +73,7 @@ return status, vsxml def print_err(err, detail, cn): - logger.error(err % cn) + logger.error(err, cn) logger.error("Exception: %s", detail) def get_inst_from_list(cn, qcn, list, filter, exp_val): @@ -82,7 +82,7 @@ inst = None if len(list) < 1: - logger.error("%s returned %i %s objects" % (qcn, len(list), cn)) + logger.error("%s returned %i %s objects", qcn, len(list), cn) return FAIL, None for inst in list: @@ -92,7 +92,7 @@ if ret != PASS: status = FAIL - logger.error("%s with %s was not returned" % (cn, exp_val)) + logger.error("%s with %s was not returned", cn, exp_val) return status, inst @@ -107,7 +107,7 @@ logger.error("Hostname mismatch") except Exception, detail: - logger.error("Exception in %s : %s" % (cn, detail)) + logger.error("Exception in %s : %s", cn, detail) status = FAIL return status, host_inst.Name, host_inst.CreationClassName @@ -236,7 +236,7 @@ if status != PASS: return status else: - logger.error("Unexpected instance type %s" % cn) + logger.error("Unexpected instance type %s", cn) return FAIL except Exception, detail: @@ -248,10 +248,10 @@ def check_rasd_vals(inst, rt): try: if inst['ResourceType'] != rt: - logger.error("In ResourceType for %s " % rt) + logger.error("In ResourceType for %s ", rt) return FAIL except Exception, detail: - logger.error("Error checking RASD attribute values %s" % detail) + logger.error("Error checking RASD attribute values %s", detail) return FAIL return PASS diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/HostSystem/04_hs_to_EAPF.py --- a/suites/libvirt-cim/cimtest/HostSystem/04_hs_to_EAPF.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/HostSystem/04_hs_to_EAPF.py Fri Feb 06 01:54:39 2009 -0800 @@ -70,7 +70,7 @@ libvirt_input_graphics_changeset = 757 def print_err(err, detail, cn): - logger.error(err % cn) + logger.error(err, cn) logger.error("Exception: %s", detail) def pool_init_list(virt, pool_assoc, net_name, dp_InstID): @@ -194,8 +194,8 @@ def check_len(an, assoc_list_info, qcn, exp_len): if len(assoc_list_info) < exp_len: - logger.error("%s returned %i %s objects" % (an, - len(assoc_list_info), qcn)) + logger.error("%s returned %i %s objects", + an, len(assoc_list_info), qcn) return FAIL return PASS diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/HostSystem/06_hs_to_vsms.py --- a/suites/libvirt-cim/cimtest/HostSystem/06_hs_to_vsms.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/HostSystem/06_hs_to_vsms.py Fri Feb 06 01:54:39 2009 -0800 @@ -56,7 +56,7 @@ sup_types = ['Xen', 'KVM', 'XenFV', 'LXC'] def print_err(err, detail, cn): - logger.error(err % cn) + logger.error(err, cn) logger.error("Exception: %s", detail) def print_field_error(fieldname, ret_value, exp_value): @@ -76,7 +76,7 @@ # When no records are found. if ret != PASS: - logger.error("%s with %s was not returned" % (cn, exp_val)) + logger.error("%s with %s was not returned", cn, exp_val) status = FAIL return status, inst diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/HostedDependency/02_reverse.py --- a/suites/libvirt-cim/cimtest/HostedDependency/02_reverse.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/HostedDependency/02_reverse.py Fri Feb 06 01:54:39 2009 -0800 @@ -72,12 +72,12 @@ ret = cxml.cim_define(server) if not ret: - logger.error("Failed to define the dom: %s" % test_dom) + logger.error("Failed to define the dom: %s", test_dom) return FAIL rc = call_request_state_change(test_dom, server, 2, TIME, virt) if rc != 0: - logger.error("Failed to start the dom: %s" % test_dom) + logger.error("Failed to start the dom: %s", test_dom) cxml.undefine(server) return FAIL @@ -126,7 +126,7 @@ if guest["Name"] in cs_names: cs_names.remove(guest["Name"]) else: - logger.error("HostedDependency returned unexpected guest %s" % + logger.error("HostedDependency returned unexpected guest %s", guest["Name"]) status = FAIL @@ -140,7 +140,7 @@ # not being returned by HostedDependency for guest in cs_names: - logger.error("HostedDependency did not return expected guest %s" % + logger.error("HostedDependency did not return expected guest %s", guest["Name"]) status = FAIL diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/HostedDependency/03_enabledstate.py --- a/suites/libvirt-cim/cimtest/HostedDependency/03_enabledstate.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/HostedDependency/03_enabledstate.py Fri Feb 06 01:54:39 2009 -0800 @@ -80,7 +80,7 @@ except Exception, detail: logger.error(CIM_ERROR_GETINSTANCE, 'ComputerSystem') - logger.error("Exception: %s" % detail) + logger.error("Exception: %s", detail) status = FAIL return status, dom_field_list @@ -113,18 +113,18 @@ ret = cxml.cim_define(server) if not ret: - logger.error("Failed to define the dom: %s" % test_dom) + logger.error("Failed to define the dom: %s", test_dom) return FAIL rc = call_request_state_change(test_dom, server, 2, TIME, virt) if rc != 0: - logger.error("Failed to start the dom: %s" % test_dom) + logger.error("Failed to start the dom: %s", test_dom) cxml.undefine(server) return FAIL rc = call_request_state_change(test_dom, server, 9, TIME, virt) if rc != 0: - logger.error("Failed to suspend the dom: %s" % test_dom) + logger.error("Failed to suspend the dom: %s", test_dom) cxml.destroy(server) cxml.undefine(server) @@ -181,7 +181,7 @@ except Exception, detail: logger.error(CIM_ERROR_ASSOCIATORS,'HostedDependency') - logger.error("Exception: %s" % detail) + logger.error("Exception: %s", detail) status = FAIL cxml.destroy(server) diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/HostedDependency/04_reverse_errs.py --- a/suites/libvirt-cim/cimtest/HostedDependency/04_reverse_errs.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/HostedDependency/04_reverse_errs.py Fri Feb 06 01:54:39 2009 -0800 @@ -91,7 +91,7 @@ ret = cxml.create(server) if not ret: - logger.error("Failed to Create the dom: %s" % test_dom) + logger.error("Failed to Create the dom: %s", test_dom) return FAIL conn = assoc.myWBEMConnection('http://%s' % server, diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/HostedResourcePool/01_forward.py --- a/suites/libvirt-cim/cimtest/HostedResourcePool/01_forward.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/HostedResourcePool/01_forward.py Fri Feb 06 01:54:39 2009 -0800 @@ -58,7 +58,7 @@ Name = host_sys, CreationClassName = host_cn) except Exception, details: - logger.error(Globals.CIM_ERROR_ASSOCIATORNAMES % assoc_cn) + logger.error(Globals.CIM_ERROR_ASSOCIATORNAMES, assoc_cn) logger.error("Exception:", details) return FAIL diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/HostedResourcePool/02_reverse.py --- a/suites/libvirt-cim/cimtest/HostedResourcePool/02_reverse.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/HostedResourcePool/02_reverse.py Fri Feb 06 01:54:39 2009 -0800 @@ -64,7 +64,7 @@ try: assoc_host = AssociatorNames(options.ip, assoc_cn, k, InstanceID=v) except Exception: - logger.error(Globals.CIM_ERROR_ASSOCIATORNAMES % assoc_cn) + logger.error(Globals.CIM_ERROR_ASSOCIATORNAMES, assoc_cn) return FAIL if len(assoc_host) == 1: if assoc_host[0].keybindings['Name'] != host_sys: diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/HostedService/01_forward.py --- a/suites/libvirt-cim/cimtest/HostedService/01_forward.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/HostedService/01_forward.py Fri Feb 06 01:54:39 2009 -0800 @@ -58,7 +58,7 @@ Name = host_name) except Exception, deatils: - logger.error(Globals.CIM_ERROR_ASSOCIATORNAMES % host_name) + logger.error(Globals.CIM_ERROR_ASSOCIATORNAMES, host_name) logger.error("Exception: details %s", details) return FAIL diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/LogicalDisk/01_disk.py --- a/suites/libvirt-cim/cimtest/LogicalDisk/01_disk.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/LogicalDisk/01_disk.py Fri Feb 06 01:54:39 2009 -0800 @@ -58,11 +58,11 @@ status = 0 if dev.Name != test_dev: - logger.error("Name should be `%s' instead of `%s'" % (test_dev, dev.Name)) + logger.error("Name should be `%s' instead of `%s'", test_dev, dev.Name) status = 1 if status == 0: - logger.info("Checked device %s" % dev.Name) + logger.info("Checked device %s", dev.Name) vsxml.undefine(options.ip) diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/LogicalDisk/02_nodevs.py --- a/suites/libvirt-cim/cimtest/LogicalDisk/02_nodevs.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/LogicalDisk/02_nodevs.py Fri Feb 06 01:54:39 2009 -0800 @@ -69,7 +69,7 @@ return FAIL if len(devs) != 0: - logger.error("%s returned %d instead of empty list" % (cn, len(devs))) + logger.error("%s returned %d instead of empty list", cn, len(devs)) status = FAIL else: status = PASS diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/Memory/01_memory.py --- a/suites/libvirt-cim/cimtest/Memory/01_memory.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/Memory/01_memory.py Fri Feb 06 01:54:39 2009 -0800 @@ -63,11 +63,11 @@ capacity = dev.ConsumableBlocks * dev.BlockSize / 1024 if capacity != alloc_mem: - logger.error("Capacity should be %i MB instead of %i MB" % (alloc_mem, capacity)) + logger.error("Capacity should be %i MB instead of %i MB", alloc_mem, capacity) status = 1 if status == 0: - logger.info("Checked memory capacity: %s MB" % capacity) + logger.info("Checked memory capacity: %s MB", capacity) vsxml.undefine(options.ip) return status diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/Memory/02_defgetmem.py --- a/suites/libvirt-cim/cimtest/Memory/02_defgetmem.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/Memory/02_defgetmem.py Fri Feb 06 01:54:39 2009 -0800 @@ -76,7 +76,7 @@ raise Exception("Memory inst for %s not as expected." % default_dom) except Exception, detail: - logger.error("Exception: %s" % detail) + logger.error("Exception: %s", detail) status = FAIL cxml.undefine(options.ip) diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/NetworkPort/01_netport.py --- a/suites/libvirt-cim/cimtest/NetworkPort/01_netport.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/NetworkPort/01_netport.py Fri Feb 06 01:54:39 2009 -0800 @@ -80,12 +80,12 @@ dev = GetInstance(options.ip, net_class, key_list) except Exception, detail: - logger.error("Exception: %s" % detail) + logger.error("Exception: %s", detail) vsxml.undefine(options.ip) return FAIL if dev.DeviceID == None: - logger.error("Error retrieving instance for devid %s" % devid) + logger.error("Error retrieving instance for devid %s", devid) vsxml.undefine(options.ip) return FAIL @@ -94,23 +94,23 @@ link_tech = get_linktech(options.ip, options.virt) if dev.LinkTechnology != link_tech: - logger.error("LinkTechnology should be set to `%i' instead of `%s'" % \ - (link_tech, dev.LinkTechnology)) + logger.error("LinkTechnology should be set to `%i' instead of `%s'", + link_tech, dev.LinkTechnology) status = FAIL addrs = dev.NetworkAddresses if len(addrs) != 1: - logger.error("Too many NetworkAddress entries (%i instead of %i)" % \ - (len(addrs), 1)) + logger.error("Too many NetworkAddress entries (%i instead of %i)", + len(addrs), 1) status = FAIL if addrs[0] != test_mac: - logger.error("MAC address reported incorrectly (%s instead of %s)" % \ - (addrs[0], test_mac)) + logger.error("MAC address reported incorrectly (%s instead of %s)", + addrs[0], test_mac) status = FAIL if status == FAIL: - logger.error("Checked interface %s" % test_mac) + logger.error("Checked interface %s", test_mac) vsxml.undefine(options.ip) diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/NetworkPort/03_user_netport.py --- a/suites/libvirt-cim/cimtest/NetworkPort/03_user_netport.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/NetworkPort/03_user_netport.py Fri Feb 06 01:54:39 2009 -0800 @@ -45,7 +45,7 @@ cxml = KVMXML(test_dom, mac = test_mac, ntype='user') ret = cxml.cim_define(options.ip) if not ret: - logger.error('Unable to define domain %s' % test_dom) + logger.error('Unable to define domain %s', test_dom) return FAIL devid = "%s/%s" % (test_dom, test_mac) @@ -59,7 +59,7 @@ try: dev = GetInstance(options.ip, 'KVM_NetworkPort', key_list) except Exception, detail: - logger.error("Exception: %s" % detail) + logger.error("Exception: %s", detail) cxml.undefine(options.ip) return FAIL @@ -73,17 +73,17 @@ addrs = dev.NetworkAddresses if len(addrs) != 1: - logger.error("Too many NetworkAddress entries (%i instead of %i)" % \ - (len(addrs), 1)) + logger.error("Too many NetworkAddress entries (%i instead of %i)", + len(addrs), 1) status = FAIL if addrs[0] != test_mac: - logger.error("MAC address reported incorrectly (%s instead of %s)" % \ - (addrs[0], test_mac)) + logger.error("MAC address reported incorrectly (%s instead of %s)", + addrs[0], test_mac) status = FAIL if status == FAIL: - logger.error("Checked interface %s" % test_mac) + logger.error("Checked interface %s", test_mac) cxml.undefine(options.ip) return status diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/Processor/01_processor.py --- a/suites/libvirt-cim/cimtest/Processor/01_processor.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/Processor/01_processor.py Fri Feb 06 01:54:39 2009 -0800 @@ -64,11 +64,11 @@ try: dev = GetInstance(options.ip, proc_class, key_list) if dev.DeviceID == devid: - logger.info("Checked device %s" % devid) + logger.info("Checked device %s", devid) else: - logger.error("Mismatching device, returned %s instead %s" % (dev.DeviceID, devid)) + logger.error("Mismatching device, returned %s instead %s", dev.DeviceID, devid) except Exception, details: - logger.error("Error check device %s: %s" % (devid, details)) + logger.error("Error check device %s: %s", devid, details) status = 1 vsxml.stop(options.ip) diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/Processor/02_definesys_get_procs.py --- a/suites/libvirt-cim/cimtest/Processor/02_definesys_get_procs.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/Processor/02_definesys_get_procs.py Fri Feb 06 01:54:39 2009 -0800 @@ -86,7 +86,7 @@ % default_dom) except Exception, detail: - logger.error("Exception: %s" % detail) + logger.error("Exception: %s", detail) status = FAIL cxml.undefine(options.ip) diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/Profile/01_enum.py --- a/suites/libvirt-cim/cimtest/Profile/01_enum.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/Profile/01_enum.py Fri Feb 06 01:54:39 2009 -0800 @@ -66,16 +66,16 @@ x.RegisteredName, x.RegisteredVersion] for x in proflist] for exp_prof in explist: if exp_prof in checklist: - logger.info("Profile %s found" % exp_prof[0]) + logger.info("Profile %s found", exp_prof[0]) else: - logger.error("Profile %s is not found" % exp_prof[0]) + logger.error("Profile %s is not found", exp_prof[0]) status = FAIL break if status == PASS: - logger.info("Properties check for %s passed" % cn) + logger.info("Properties check for %s passed", cn) else: - logger.error("Properties check for %s failed" % cn) + logger.error("Properties check for %s failed", cn) return status if __name__ == "__main__": diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/Profile/02_profile_to_elec.py --- a/suites/libvirt-cim/cimtest/Profile/02_profile_to_elec.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/Profile/02_profile_to_elec.py Fri Feb 06 01:54:39 2009 -0800 @@ -63,18 +63,18 @@ rc = csxml_info.cim_define(server) if not rc: - logger.error("Unable define domain %s using DefineSystem() " % test_dom) + logger.error("Unable define domain %s using DefineSystem() ", test_dom) status = FAIL except Exception, detail: - logger.error("Exception defining domain %s" % test_dom) + logger.error("Exception defining domain %s", test_dom) logger.error("Exception: %s", detail) status = FAIL return status, csxml_info def print_err(err, detail, cn): - logger.error(err % cn) + logger.error(err, cn) logger.error("Exception: %s", detail) def get_expected_inst(cn, list, property, exp): @@ -84,7 +84,7 @@ return PASS, x except Exception: pass - logger.error("%s with %s was not returned" % (cn, exp)) + logger.error("%s with %s was not returned", cn, exp) return FAIL, None diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/RedirectionService/03_RedirectionSAP_errs.py --- a/suites/libvirt-cim/cimtest/RedirectionService/03_RedirectionSAP_errs.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/RedirectionService/03_RedirectionSAP_errs.py Fri Feb 06 01:54:39 2009 -0800 @@ -140,7 +140,7 @@ if status != PASS: - logger.error(" -------------- FAILED %s ----------- : " % test_val) + logger.error(" -------------- FAILED %s ----------- : ", test_val) break cxml.cim_destroy(options.ip) diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/ResourceAllocationFromPool/01_forward.py --- a/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/01_forward.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/01_forward.py Fri Feb 06 01:54:39 2009 -0800 @@ -82,7 +82,7 @@ for rasd in rasd_list: guest, dev, status = parse_instance_id(rasd.InstanceID) if status != PASS: - logger.error("Unable to parse InstanceID: %s" % rasd.InstanceID) + logger.error("Unable to parse InstanceID: %s", rasd.InstanceID) return rasd_insts, FAIL if guest == guest_name: @@ -108,7 +108,7 @@ for inst in list: guest, id, status = parse_instance_id(inst.InstanceID) if status != PASS: - logger.error("Unable to parse InstanceID: %s" % inst.InstanceID) + logger.error("Unable to parse InstanceID: %s", inst.InstanceID) return None, FAIL if id == exp_id: @@ -169,8 +169,8 @@ if rasd['InstanceID'] == exp_rasd.InstanceID: status = PASS else: - logger.info("Got %s instead of %s" % (rasd['InstanceID'], - exp_rasd.InstanceID)) + logger.info("Got %s instead of %s", rasd['InstanceID'], + exp_rasd.InstanceID) status = FAIL if status != PASS: diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/ResourceAllocationFromPool/02_reverse.py --- a/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/02_reverse.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/02_reverse.py Fri Feb 06 01:54:39 2009 -0800 @@ -81,7 +81,7 @@ for rasd in rasd_list: guest, dev, status = parse_instance_id(rasd.InstanceID) if status != PASS: - logger.error("Unable to parse InstanceID: %s" % rasd.InstanceID) + logger.error("Unable to parse InstanceID: %s", rasd.InstanceID) return rasd_insts, FAIL if guest == guest_name: @@ -107,7 +107,7 @@ for inst in list: guest, id, status = parse_instance_id(inst.InstanceID) if status != PASS: - logger.error("Unable to parse InstanceID: %s" % inst.InstanceID) + logger.error("Unable to parse InstanceID: %s", inst.InstanceID) return None, FAIL if id == exp_id: diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/ResourceAllocationFromPool/03_forward_errs.py --- a/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/03_forward_errs.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/03_forward_errs.py Fri Feb 06 01:54:39 2009 -0800 @@ -65,13 +65,15 @@ logger.info("Got excepted rc code and error string") status = PASS else: - logger.error("Unexpected rc code %s and description %s\n" %(rc, desc)) + logger.error("Unexpected rc code %s and description %s\n", rc, desc) except Exception, details: logger.error("Unknown exception happened") logger.error(details) if rc == 0: - logger.error("ResourceAllocationFromPool associator should NOT return excepted result with a wrong InstanceID value of %s input" %k) + logger.error("ResourceAllocationFromPool associator should NOT \ + return excepted result with a wrong InstanceID \ + value of %s input", k) status = FAIL return status diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/ResourceAllocationFromPool/04_reverse_errs.py --- a/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/04_reverse_errs.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/04_reverse_errs.py Fri Feb 06 01:54:39 2009 -0800 @@ -63,13 +63,16 @@ logger.info("Got excepted rc code and error string") status = PASS else: - logger.error("Unexpected rc code %s and description %s\n" %(rc, desc)) + logger.error("Unexpected rc code %s and description %s\n", + rc, desc) except Exception, details: logger.error("Unknown exception happened") logger.error(details) if rc == 0: - logger.error("ResourceAllocationSettingData should NOT return excepted result with a wrong InstanceID value of %s input" %k) + logger.error("ResourceAllocationSettingData should NOT return \ + excepted result with a wrong InstanceID \ + value of %s input", k) status = FAIL return status diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/ResourceAllocationFromPool/05_RAPF_err.py --- a/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/05_RAPF_err.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/ResourceAllocationFromPool/05_RAPF_err.py Fri Feb 06 01:54:39 2009 -0800 @@ -101,7 +101,7 @@ ret = PASS if ret != PASS: - logger.error("%s with %s was not returned" % (classname, exp_val)) + logger.error("%s with %s was not returned", classname, exp_val) vsxml.undefine(server) status = FAIL diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/ResourcePool/01_enum.py --- a/suites/libvirt-cim/cimtest/ResourcePool/01_enum.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/ResourcePool/01_enum.py Fri Feb 06 01:54:39 2009 -0800 @@ -79,8 +79,8 @@ def verify_fields(pool_list, poolname, cn): status = PASS if len(poolname) < 1: - logger.error("%s return %i instances, expected atleast 1 instance" \ - % (cn, len(poolname))) + logger.error("%s return %i instances, expected atleast 1 instance", + cn, len(poolname)) return FAIL exp_value = pool_list[cn][0] for i in range(0, len(poolname)): @@ -119,14 +119,14 @@ try: mempool = EnumInstances(ip, mp) except Exception: - logger.error(Globals.CIM_ERROR_ENUMERATE % mp) + logger.error(Globals.CIM_ERROR_ENUMERATE, mp) return FAIL status = verify_fields(pool_list, mempool, mp) try: propool = EnumInstances(ip, pp) except Exception: - logger.error(Globals.CIM_ERROR_ENUMERATE % pp) + logger.error(Globals.CIM_ERROR_ENUMERATE, pp) return FAIL status = verify_fields(pool_list, propool, pp) @@ -134,14 +134,14 @@ try: diskpool = EnumInstances(ip, dp) except Exception: - logger.error(Globals.CIM_ERROR_ENUMERATE % dp) + logger.error(Globals.CIM_ERROR_ENUMERATE, dp) return FAIL status = verify_fields(pool_list, diskpool, dp) try: netpool = EnumInstances(ip, np) except Exception: - logger.error(Globals.CIM_ERROR_ENUMERATE % np) + logger.error(Globals.CIM_ERROR_ENUMERATE, np) return FAIL status = verify_fields(pool_list, netpool, np) diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/ResourcePoolConfigurationCapabilities/01_enum.py --- a/suites/libvirt-cim/cimtest/ResourcePoolConfigurationCapabilities/01_enum.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/ResourcePoolConfigurationCapabilities/01_enum.py Fri Feb 06 01:54:39 2009 -0800 @@ -43,7 +43,7 @@ if len(rpcc) != 1: Globals.logger.error("%s_ResourcePoolConfigurationCapabilities return %i instances, \ - excepted only 1 instance" % (options.virt, len(rpcc))) + excepted only 1 instance", options.virt, len(rpcc)) return FAIL if rpcc[0].InstanceID != "RPCC": Globals.logger.error("error result of enum ResourcePoolConfigurationCapabilities") diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/01_enum.py --- a/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/01_enum.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/01_enum.py Fri Feb 06 01:54:39 2009 -0800 @@ -51,7 +51,7 @@ try: rpcservice = rpcs.enumerate(server, classname) except Exception: - logger.error(Globals.CIM_ERROR_ENUMERATE % classname) + logger.error(Globals.CIM_ERROR_ENUMERATE, classname) return FAIL valid_service = {"Name" : "RPCS", diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/04_CreateChildResourcePool.py --- a/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/04_CreateChildResourcePool.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/04_CreateChildResourcePool.py Fri Feb 06 01:54:39 2009 -0800 @@ -72,8 +72,8 @@ logger.info("Error string is '%s'", desc) return PASS else: - logger.error("Unexpected rc code %s and description %s\n" \ - %(err_no, desc)) + logger.error("Unexpected rc code %s and description %s\n", + err_no, desc) return FAIL logger.error("The execution should not have reached here!!") diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/05_AddResourcesToResourcePool.py --- a/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/05_AddResourcesToResourcePool.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/05_AddResourcesToResourcePool.py Fri Feb 06 01:54:39 2009 -0800 @@ -72,8 +72,8 @@ logger.info("Error string is '%s'", desc) return PASS else: - logger.error("Unexpected rc code %s and description %s\n" \ - %(err_no, desc)) + logger.error("Unexpected rc code %s and description %s\n", + err_no, desc) print desc return XFAIL_RC(bug) diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/06_RemoveResourcesFromResourcePool.py --- a/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/06_RemoveResourcesFromResourcePool.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/06_RemoveResourcesFromResourcePool.py Fri Feb 06 01:54:39 2009 -0800 @@ -70,8 +70,8 @@ logger.info("Error string is '%s'", desc) return PASS else: - logger.error("Unexpected rc code %s and description %s\n" \ - %(err_no, desc)) + logger.error("Unexpected rc code %s and description %s\n", + err_no, desc) return FAIL logger.error("The execution should not have reached here!!") diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/07_DeleteResourcePool.py --- a/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/07_DeleteResourcePool.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/ResourcePoolConfigurationService/07_DeleteResourcePool.py Fri Feb 06 01:54:39 2009 -0800 @@ -66,8 +66,8 @@ logger.info("Error string is '%s'", desc) return PASS else: - logger.error("Unexpected rc code %s and description %s\n" \ - %(err_no, desc)) + logger.error("Unexpected rc code %s and description %s\n", + err_no, desc) return FAIL logger.error("The execution should not have reached here!!") diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/SettingsDefine/01_forward.py --- a/suites/libvirt-cim/cimtest/SettingsDefine/01_forward.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/SettingsDefine/01_forward.py Fri Feb 06 01:54:39 2009 -0800 @@ -77,7 +77,7 @@ for dev in dev_list: guest, dev_id, status = parse_instance_id(dev.DeviceID) if status != PASS: - logger.error("Unable to parse InstanceID: %s" % dev.DeviceID) + logger.error("Unable to parse InstanceID: %s", dev.DeviceID) return dev_insts, FAIL if guest == guest_name: @@ -102,7 +102,7 @@ for rasd in rasd_list: guest, dev, status = parse_instance_id(rasd.InstanceID) if status != PASS: - logger.error("Unable to parse InstanceID: %s" % rasd.InstanceID) + logger.error("Unable to parse InstanceID: %s", rasd.InstanceID) return rasd_insts, FAIL if guest == guest_name: @@ -126,8 +126,8 @@ if rasd['InstanceID'] == exp_rasd.InstanceID: status = PASS else: - logger.info("Got %s instead of %s" % (rasd['InstanceID'], - exp_rasd.InstanceID)) + logger.info("Got %s instead of %s", rasd['InstanceID'], + exp_rasd.InstanceID) status = FAIL if status != PASS: diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/SettingsDefine/02_reverse.py --- a/suites/libvirt-cim/cimtest/SettingsDefine/02_reverse.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/SettingsDefine/02_reverse.py Fri Feb 06 01:54:39 2009 -0800 @@ -104,7 +104,7 @@ for rasd in rasd_list: guest, dev, status = parse_instance_id(rasd.InstanceID) if status != PASS: - logger.error("Unable to parse InstanceID: %s" % rasd.InstanceID) + logger.error("Unable to parse InstanceID: %s", rasd.InstanceID) return rasd_insts, FAIL if guest == guest_name: @@ -124,7 +124,7 @@ for dev in dev_list: guest, dev_id, status = parse_instance_id(dev.DeviceID) if status != PASS: - logger.error("Unable to parse InstanceID: %s" % dev.DeviceID) + logger.error("Unable to parse InstanceID: %s", dev.DeviceID) return dev_insts, FAIL if guest == guest_name: diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/SettingsDefine/03_sds_fwd_errs.py --- a/suites/libvirt-cim/cimtest/SettingsDefine/03_sds_fwd_errs.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/SettingsDefine/03_sds_fwd_errs.py Fri Feb 06 01:54:39 2009 -0800 @@ -200,7 +200,7 @@ ret_val = try_assoc(conn, classname, ac_classname, keys, field_name=field, expr_values=expr_values[field], bug_no='') if ret_val != PASS: - logger.error("------ FAILED: %s------" % field) + logger.error("------ FAILED: %s------", field) name_val[i] = temp return ret_val diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/SettingsDefineCapabilities/01_forward.py --- a/suites/libvirt-cim/cimtest/SettingsDefineCapabilities/01_forward.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/SettingsDefineCapabilities/01_forward.py Fri Feb 06 01:54:39 2009 -0800 @@ -82,7 +82,7 @@ try: instance = enumclass.GetInstance(ip, pool_class, key_list) except Exception, detail: - logger.error(CIM_ERROR_GETINSTANCE, '%s' % pool_class) + logger.error(CIM_ERROR_GETINSTANCE, '%s', pool_class) logger.error("Exception: %s", detail) sys.exit(FAIL) return instance diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/SystemDevice/01_forward.py --- a/suites/libvirt-cim/cimtest/SystemDevice/01_forward.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/SystemDevice/01_forward.py Fri Feb 06 01:54:39 2009 -0800 @@ -63,7 +63,7 @@ ret = cxml.create(server) if not ret: - logger.error('Unable to create domain %s' % test_dom) + logger.error('Unable to create domain %s', test_dom) return FAIL sd_classname = get_typed_class(virt, 'SystemDevice') diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/SystemDevice/02_reverse.py --- a/suites/libvirt-cim/cimtest/SystemDevice/02_reverse.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/SystemDevice/02_reverse.py Fri Feb 06 01:54:39 2009 -0800 @@ -63,7 +63,7 @@ try: devs = enumclass.EnumInstances(options.ip, cn) except Exception, detail: - logger.error("Exception: %s" % detail) + logger.error("Exception: %s", detail) cxml.destroy(options.ip) cxml.undefine(options.ip) return FAIL @@ -81,7 +81,7 @@ SystemName=dev.SystemName, SystemCreationClassName=dev.SystemCreationClassName) except Exception, detail: - logger.error("Exception: %s" % detail) + logger.error("Exception: %s", detail) cxml.destroy(options.ip) cxml.undefine(options.ip) return FAIL @@ -92,7 +92,7 @@ cxml.undefine(options.ip) return FAIL elif len(systems) != 1: - logger.error("%s systems returned, expected 1" % len(systems)) + logger.error("%s systems returned, expected 1", len(systems)) cxml.destroy(options.ip) cxml.undefine(options.ip) return FAIL @@ -106,9 +106,9 @@ if system.Name == test_dom: status = PASS - logger.info("Examined %s %s" % (system.Name, dev.DeviceID)) + logger.info("Examined %s %s", system.Name, dev.DeviceID) else: - logger.error("Association returned wrong system: %s" % + logger.error("Association returned wrong system: %s", system.Name) cxml.destroy(options.ip) diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/SystemDevice/03_fwderrs.py --- a/suites/libvirt-cim/cimtest/SystemDevice/03_fwderrs.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/SystemDevice/03_fwderrs.py Fri Feb 06 01:54:39 2009 -0800 @@ -101,7 +101,7 @@ names[item] = ("DeviceID" , dev.DeviceID ) except Exception, details: - logger.info("Exception %s for class %s" % (details , item)) + logger.info("Exception %s for class %s", details , item) return FAIL if len(name) <=0 or len(names) <= 0: @@ -150,10 +150,10 @@ if ((rc != exp_rc1 and desc.find(exp_desc1) <= 0) and (rc != exp_rc2 and desc.find(exp_desc2) <= 0)): status = FAIL - logger.info("Class = %s , key = %s , keyval = %s " \ - % (item, i , keyval)) - logger.info("Unexpected rc %s and desc %s for %s" - % (rc, desc, item)) + logger.info("Class = %s , key = %s , keyval = %s ", + item, i, keyval) + logger.info("Unexpected rc %s and desc %s for %s", + rc, desc, item) except Exception, details: logger.info("Unknown exception happened") @@ -162,8 +162,8 @@ if rc == 0: logger.info("Success returned for wrong key and ID") - logger.info("Class = %s , key = %s , keyval = %s " % - (item, i , keyval)) + logger.info("Class = %s , key = %s , keyval = %s ", + item, i , keyval) return XFAIL_RC(bug) except Exception, details: diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/VSSD/01_enum.py --- a/suites/libvirt-cim/cimtest/VSSD/01_enum.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/VSSD/01_enum.py Fri Feb 06 01:54:39 2009 -0800 @@ -67,28 +67,28 @@ break if found == 1: if vssd.ElementName != test_dom: - logger.error("Invalid ElementName- expecting %s, go %s" % + logger.error("Invalid ElementName- expecting %s, go %s", test_dom, vssd.ElementName) vsxml.undefine(options.ip) return FAIL - logger.info("Examining VSSD class for the Guest %s" % test_dom) + logger.info("Examining VSSD class for the Guest %s", test_dom) try: name = vssd.ElementName idx = live_cs.index(name) del live_cs[idx] except BaseException, details: - logger.error("Exception %s" % details) - logger.error("Provider reports VSSD `%s', but xm does not" % + logger.error("Exception %s", details) + logger.error("Provider reports VSSD `%s', but xm does not", vssd.ElementName) status = FAIL else: - logger.error("Missing VSSD instance for the system %s " % test_dom) + logger.error("Missing VSSD instance for the system %s ", test_dom) status = FAIL except BaseException, details: - logger.error("Exception %s" % details) + logger.error("Exception %s", details) status = FAIL vsxml.undefine(options.ip) diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/VSSD/02_bootldr.py --- a/suites/libvirt-cim/cimtest/VSSD/02_bootldr.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/VSSD/02_bootldr.py Fri Feb 06 01:54:39 2009 -0800 @@ -66,14 +66,14 @@ name = system.ElementName if name == test_dom : if system.Bootloader == bootldr : - logger.info("BootLoader for domain %s is %s" % (name, bootldr )) + logger.info("BootLoader for domain %s is %s", name, bootldr) status = 0 else: - logger.error("Bootloader is not set for VS %s" % test_dom) + logger.error("Bootloader is not set for VS %s", test_dom) status = 1 except Exception, detail : - logger.error("Exception : %s" % detail) + logger.error("Exception : %s", detail) status = 1 xmlfile.undefine(options.ip) diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/VSSD/04_vssd_to_rasd.py --- a/suites/libvirt-cim/cimtest/VSSD/04_vssd_to_rasd.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/VSSD/04_vssd_to_rasd.py Fri Feb 06 01:54:39 2009 -0800 @@ -101,7 +101,7 @@ # When no records are found. if ret != PASS: - logger.error("%s with %s was not returned" % (classname, exp_val)) + logger.error("%s with %s was not returned", classname, exp_val) status = FAIL # We expect only one record to be returned. @@ -153,7 +153,7 @@ InstanceID = instIdval) if len(vssdc_assoc_info) == 1 and \ vssdc_assoc_info[0].classname == 'LXC_MemResourceAllocationSettingData': - logger.info("%s returned expect objects" % assoc_cname) + logger.info("%s returned expect objects", assoc_cname) elif len(vssdc_assoc_info) < 4: logger.error("%s returned %i %s objects, expected 4", assoc_cname, len(vssdc_assoc_info), qcn) @@ -161,7 +161,7 @@ except Exception, details: logger.error(CIM_ERROR_ASSOCIATORS, assoc_cname) - logger.error("Exception : %s" % details) + logger.error("Exception : %s", details) status = FAIL return status, vssdc_assoc_info @@ -202,7 +202,7 @@ logger.error("Mistmatching %s values", CCName ) break except Exception, detail : - logger.error("Exception in verify_rasd_values function: %s" % detail) + logger.error("Exception in verify_rasd_values function: %s", detail) status = FAIL return status diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/VirtualSystemManagementService/01_definesystem_name.py --- a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/01_definesystem_name.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/01_definesystem_name.py Fri Feb 06 01:54:39 2009 -0800 @@ -39,12 +39,12 @@ ret = cxml.cim_define(options.ip) if not ret: - logger.error("Unable to define %s" % default_dom) + logger.error("Unable to define %s", default_dom) return FAIL status = cxml.cim_start(options.ip) if status != PASS: - logger.error("Failed to start the defined domain: %s" % default_dom) + logger.error("Failed to start the defined domain: %s", default_dom) cxml.cim_destroy(options.ip) cxml.undefine(options.ip) diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/VirtualSystemManagementService/02_destroysystem.py --- a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/02_destroysystem.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/02_destroysystem.py Fri Feb 06 01:54:39 2009 -0800 @@ -76,7 +76,7 @@ list_after = domain_list(options.ip, options.virt) if default_dom in list_after: - logger.error("Domain %s not destroyed: provider didn't return error" % \ + logger.error("Domain %s not destroyed: provider didn't return error", default_dom) cleanup_env(options.ip, cxml) status = FAIL diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/VirtualSystemManagementService/05_destroysystem_neg.py --- a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/05_destroysystem_neg.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/05_destroysystem_neg.py Fri Feb 06 01:54:39 2009 -0800 @@ -73,7 +73,7 @@ logger.info('Got expected error desc: %s',err_desc) return PASS - logger.error('destroy_fail>> %s: Error executing DestroySystem' % tc) + logger.error('destroy_fail>> %s: Error executing DestroySystem', tc) logger.error(details) return FAIL diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/VirtualSystemManagementService/07_addresource_neg.py --- a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/07_addresource_neg.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/07_addresource_neg.py Fri Feb 06 01:54:39 2009 -0800 @@ -57,7 +57,7 @@ bad_inst = 'instance of what ever { dd = 3; //\ ]&' ret = service.AddResourceSettings(AffectedConfiguration=vssd_ref, ResourceSettings=[bad_inst]) - logger.info('ret[0] = %s' % ret[0]) + logger.info('ret[0] = %s', ret[0]) if ret[0] == None: logger.error('AddRS should NOT return OK with wrong RS input') rc = 0 @@ -66,8 +66,8 @@ logger.info('Got expected rc code and error string.') status = PASS else: - logger.error('Unexpected rc code %s and description:\n %s' % - (rc, desc)) + logger.error('Unexpected rc code %s and description:\n %s', + rc, desc) status = FAIL except Exception, details: logger.error('Error invoking AddRS') diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/VirtualSystemManagementService/09_procrasd_persist.py --- a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/09_procrasd_persist.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/09_procrasd_persist.py Fri Feb 06 01:54:39 2009 -0800 @@ -104,7 +104,7 @@ status = check_proc_sched(options.ip, options.virt) if status != PASS: - raise Exception("%s CPU scheduling not set properly", default_dom) + raise Exception("%s CPU scheduling not set properly" % default_dom) status = PASS diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/VirtualSystemManagementService/10_hv_version.py --- a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/10_hv_version.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/10_hv_version.py Fri Feb 06 01:54:39 2009 -0800 @@ -50,14 +50,14 @@ local_ver = get_hv_ver(options.ip, options.virt) if cim_ver != local_ver: - logger.error("CIM says version is `%s', but libvirt says `%s'" \ - % (cim_ver, local_ver)) + logger.error("CIM says version is `%s', but libvirt says `%s'", + cim_ver, local_ver) if options.virt == 'LXC': return XFAIL_RC(bug_libvirt) else: return FAIL else: - logger.info("Verified %s == %s" % (cim_ver, local_ver)) + logger.info("Verified %s == %s", cim_ver, local_ver) except Exception, details: logger.error(details) return FAIL diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/VirtualSystemManagementService/11_define_memrasdunits.py --- a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/11_define_memrasdunits.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/11_define_memrasdunits.py Fri Feb 06 01:54:39 2009 -0800 @@ -67,7 +67,7 @@ ret = cxml.cim_define(options.ip) if not ret: - logger.error("DefineSystem with (%s) units failed" % units) + logger.error("DefineSystem with (%s) units failed", units) return FAIL return PASS @@ -94,10 +94,10 @@ cim_kb = int(the_rasd["VirtualQuantity"]) if cim_kb != mem_kb: - logger.error("CIM reports %i KB instead of %i KB" % (cim_kb, mem_kb)) + logger.error("CIM reports %i KB instead of %i KB", cim_kb, mem_kb) return FAIL - logger.info("Verified %i KB" % mem_kb) + logger.info("Verified %i KB", mem_kb) return PASS diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/VirtualSystemManagementService/12_referenced_config.py --- a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/12_referenced_config.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/12_referenced_config.py Fri Feb 06 01:54:39 2009 -0800 @@ -50,12 +50,12 @@ def setup_first_guest(ip, virt, cxml): ret = cxml.cim_define(ip) if not ret: - logger.error("Unable to define %s using DefineSystem()" % test_dom) + logger.error("Unable to define %s using DefineSystem()", test_dom) return FAIL, None status = cxml.cim_start(ip) if status != PASS: - logger.error("Unable to start %s" % test_dom) + logger.error("Unable to start %s", test_dom) return FAIL, "define" return PASS, "start" @@ -98,7 +98,7 @@ ret = cxml2.cim_define(ip, ref_conf=ref) if not ret: - logger.error("Unable to define %s using DefineSystem()" % test_dom2) + logger.error("Unable to define %s using DefineSystem()", test_dom2) return FAIL, None return PASS, "define" diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/VirtualSystemManagementService/13_refconfig_additional_devs.py --- a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/13_refconfig_additional_devs.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/13_refconfig_additional_devs.py Fri Feb 06 01:54:39 2009 -0800 @@ -60,33 +60,33 @@ def verify_no_dups(ip, virt, cxml, dom): if cxml.xml_get_disk_source() != cxml.dasd.Address: - logger.error("%s: Exp disk source %s" % (dom, cxml.dasd.Address)) + logger.error("%s: Exp disk source %s", dom, cxml.dasd.Address) return FAIL if cxml.xml_get_disk_dev() != cxml.dasd.VirtualDevice: - logger.error("%s: Exp disk dev %s" % (dom, cxml.dasd.VirtualDevice)) + logger.error("%s: Exp disk dev %s", dom, cxml.dasd.VirtualDevice) return FAIL if cxml.xml_get_net_type() != cxml.nasd.NetworkType: - logger.error("%s: Exp net type %d" % (dom, cxml.nasd.NetworkType)) + logger.error("%s: Exp net type %d", dom, cxml.nasd.NetworkType) return FAIL if cxml.xml_get_net_mac() != cxml.nasd.Address: - logger.error("%s: Exp net mac %s" % (dom, cxml.nasd.Address)) + logger.error("%s: Exp net mac %s", dom, cxml.nasd.Address) return FAIL vcpus = cxml.xml_get_vcpu() if not vcpus.isdigit(): - logger.error("Unable to get vcpus value for %s" % dom) + logger.error("Unable to get vcpus value for %s", dom) return FAIL if int(vcpus) != cxml.pasd.VirtualQuantity: - logger.error("%s: Exp vcpus %s" % (dom, cxml.pasd.VirtualQuantity)) + logger.error("%s: Exp vcpus %s", dom, cxml.pasd.VirtualQuantity) return FAIL mem = cxml.xml_get_mem() if not mem.isdigit(): - logger.error("Unable to get mem value for %s" % dom) + logger.error("Unable to get mem value for %s", dom) return FAIL if cxml.masd.AllocationUnits == "Bytes": @@ -107,7 +107,7 @@ exp_mem <<= shift if int(mem) != exp_mem: - logger.error("%s: Exp mem %s" % (dom, exp_mem)) + logger.error("%s: Exp mem %s", dom, exp_mem) return FAIL return PASS @@ -123,7 +123,7 @@ try: rc = cxml.cim_define(options.ip) if not rc: - logger.error("Unable define domain %s" % test_dom) + logger.error("Unable define domain %s", test_dom) raise Exception("Unable to define domain %s" % test_dom) ref = get_vssd_ref(options.ip, options.virt) @@ -132,7 +132,7 @@ rc = cxml2.cim_define(options.ip, ref_conf=ref) if not rc: - logger.error("Unable define domain %s" % test_dom2) + logger.error("Unable define domain %s", test_dom2) raise Exception("Unable to define %s" % test_dom2) rc = call_request_state_change(test_dom2, options.ip, diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/VirtualSystemMigrationService/01_migratable_host.py --- a/suites/libvirt-cim/cimtest/VirtualSystemMigrationService/01_migratable_host.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/VirtualSystemMigrationService/01_migratable_host.py Fri Feb 06 01:54:39 2009 -0800 @@ -48,7 +48,7 @@ cxml = virt_xml(guest_name) ret = cxml.create(ip) if not ret: - logger.error("Error create domain %s" % guest_name) + logger.error("Error create domain %s", guest_name) return FAIL, None, cxml status, dom_cs = poll_for_state_change(ip, virt, guest_name, @@ -104,8 +104,8 @@ status, ret = migrate_guest_to_host(service, cs_ref, target_ip) if status == FAIL: - logger.error("MigrateVirtualSystemToHost: unexpected list length %s" - % len(ret)) + logger.error("MigrateVirtualSystemToHost: unexpected list length %s", + len(ret)) cxml.destroy(options.ip) cxml.undefine(options.ip) return status diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/VirtualSystemMigrationService/02_host_migrate_type.py --- a/suites/libvirt-cim/cimtest/VirtualSystemMigrationService/02_host_migrate_type.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/VirtualSystemMigrationService/02_host_migrate_type.py Fri Feb 06 01:54:39 2009 -0800 @@ -46,7 +46,7 @@ cxml = virt_xml(guest_name) cxml.cim_define(ip) except Exception: - logger.error("Error define domain %s" % guest_name) + logger.error("Error define domain %s", guest_name) return FAIL, None classname = 'Xen_ComputerSystem' @@ -106,7 +106,7 @@ return FAIL, None except Exception: - logger.error("Error start domain %s" % guest_name) + logger.error("Error start domain %s", guest_name) return FAIL, None return PASS, cxml @@ -156,11 +156,11 @@ break logger.info("Migrating guest with the following options:") - logger.info("%s" % item) + logger.info("%s", item) status, ret = migrate_guest_to_host(service, cs_ref, target_ip, item) if status == FAIL: - logger.error("MigrateVirtualSystemToHost: unexpected list length %s" - % len(ret)) + logger.error("MigrateVirtualSystemToHost: unexpected list length %s", + len(ret)) cxml.destroy(options.ip) cxml.undefine(options.ip) return status diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/VirtualSystemMigrationService/05_migratable_host_errs.py --- a/suites/libvirt-cim/cimtest/VirtualSystemMigrationService/05_migratable_host_errs.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/VirtualSystemMigrationService/05_migratable_host_errs.py Fri Feb 06 01:54:39 2009 -0800 @@ -43,13 +43,13 @@ cxml = virt_xml(test_dom) ret = cxml.cim_define(server) if not ret: - logger.error("Error define domain %s" % test_dom ) + logger.error("Error define domain %s", test_dom ) return FAIL status = cxml.cim_start(server) if status != PASS: cxml.undefine(server) - logger.error("Error start domain %s" % test_dom ) + logger.error("Error start domain %s", test_dom ) return status status = FAIL diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/01_forward.py --- a/suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/01_forward.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/01_forward.py Fri Feb 06 01:54:39 2009 -0800 @@ -116,16 +116,16 @@ try: if len(assoc_info) != 1: - logger.error("%s returned %i resource objects for '%s'" % \ - (an, len(assoc_info), cn)) + logger.error("%s returned %i resource objects for '%s'", + an, len(assoc_info), cn) return FAIL status = compare_all_prop(assoc_info[0], vssd) if status != PASS: logger.error("Properties of inst returned by %s didn't \ - match expected" % assoc_info[0].classname) + match expected", assoc_info[0].classname) return FAIL except Exception, detail : - logger.error("Exception in assoc_values function: %s" % detail) + logger.error("Exception in assoc_values function: %s", detail) return FAIL return PASS @@ -166,12 +166,12 @@ try: vssd = enumclass.GetInstance(options.ip, vssd_cn, key_list) if vssd is None: - logger.error("VSSD instance for %s not found" % test_dom) + logger.error("VSSD instance for %s not found", test_dom) cxml.undefine(options.ip) return FAIL except Exception, detail : logger.error(Globals.CIM_ERROR_GETINSTANCE, vssd_cn) - logger.error("Exception : %s" % detail) + logger.error("Exception : %s", detail) cxml.undefine(options.ip) return FAIL @@ -191,7 +191,7 @@ except Exception, detail : logger.error(Globals.CIM_ERROR_ASSOCIATORS, an) - logger.error("Exception : %s" % detail) + logger.error("Exception : %s", detail) status = FAIL cxml.undefine(options.ip) diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/02_reverse.py --- a/suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/02_reverse.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/02_reverse.py Fri Feb 06 01:54:39 2009 -0800 @@ -70,7 +70,7 @@ return FAIL except Exception, detail : - logger.error("Exception evaluating InstanceID: %s" % detail) + logger.error("Exception evaluating InstanceID: %s", detail) return FAIL return PASS @@ -139,7 +139,7 @@ break except Exception, detail : - logger.error("Exception in assoc_values function: %s" % detail) + logger.error("Exception in assoc_values function: %s", detail) status = FAIL return status diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/03_vssdc_fwd_errs.py --- a/suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/03_vssdc_fwd_errs.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/03_vssdc_fwd_errs.py Fri Feb 06 01:54:39 2009 -0800 @@ -116,13 +116,13 @@ ret = cxml.cim_define(options.ip) if not ret: - logger.error('Unable to define domain %s' % test_dom) + logger.error('Unable to define domain %s', test_dom) return FAIL status = cxml.cim_start(options.ip) if status != PASS: cxml.undefine(options.ip) - logger.error('Unable to start domain %s' % test_dom) + logger.error('Unable to start domain %s', test_dom) return FAIL global conn diff -r 3fc2b8a20333 -r 263e285881ac suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/04_vssdc_rev_errs.py --- a/suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/04_vssdc_rev_errs.py Thu Feb 05 01:19:43 2009 -0800 +++ b/suites/libvirt-cim/cimtest/VirtualSystemSettingDataComponent/04_vssdc_rev_errs.py Fri Feb 06 01:54:39 2009 -0800 @@ -109,13 +109,13 @@ ret = cxml.cim_define(options.ip) if not ret: - logger.error('Unable to define domain %s' % test_dom) + logger.error('Unable to define domain %s', test_dom) return FAIL status = cxml.cim_start(options.ip) if status != PASS: cxml.undefine(options.ip) - logger.error('Unable to start domain %s' % test_dom) + logger.error('Unable to start domain %s', test_dom) return FAIL global conn
participants (1)
-
yunguol@cn.ibm.com