# HG changeset patch
# User Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
# Date 1213966696 25200
# Node ID 1837fcafef1281396deb7d03f6754da320af8a36
# Parent 1231fad4c1a3b673747df51a8508ff837f0b9686
[TEST] Fixing get_cs_instance() of common_util.py.
1) Initalised cs to None.
2) Modified the return statements in the fn get_cs_instance().
Signed-off-by: Deepti B. Kalakeri <deeptik(a)linux.vnet.ibm.com>
diff -r 1231fad4c1a3 -r 1837fcafef12 suites/libvirt-cim/lib/XenKvmLib/common_util.py
--- a/suites/libvirt-cim/lib/XenKvmLib/common_util.py Thu Jun 19 23:04:08 2008 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/common_util.py Fri Jun 20 05:58:16 2008 -0700
@@ -46,18 +46,19 @@ def print_field_error(fieldname, ret_val
logger.error("Returned %s instead of %s", ret_value, exp_value)
def get_cs_instance(domain_name, ip, virt='Xen'):
+ cs = None
try:
cs = computersystem.get_cs_class(virt)(ip, domain_name)
if cs.Name != domain_name:
logger.error("VS %s is not found" % domain_name)
- return 1
+ return (1, cs)
except Exception, detail:
logger.error(Globals.CIM_ERROR_GETINSTANCE,
get_typed_class(virt, 'ComputerSystem'))
logger.error("Exception: %s", detail)
- return 1
+ return (1, cs)
return (0, cs)
Show replies by date