[Libvirt-cim] [PATCH 1 of 6] 1) Fixed get_cs_instance() debug statement

Deepti B Kalakeri deeptik at linux.vnet.ibm.com
Thu Jul 31 06:02:21 UTC 2008



Kaitlin Rupert wrote:
>>
>> +def verify_err_desc(exp_rc, exp_desc, err_no, err_desc):
>> + if err_no == exp_rc and err_desc.find(exp_desc) >= 0:
>> + logger.info("Got expected exception where ")
>> + logger.info("Errno is '%s' ", exp_rc)
>> + logger.info("Error string is '%s'", exp_desc)
>> + return PASS
>> + else:
>> + logger.error("Unexpected rc code %s and description %s\n", + 
>> (err_no, err_desc))
>> + return FAIL
>> +\
>
> I don't think we need to add this to a common library. The libraries 
> are becoming cluttered, and it's often difficult to tell what library 
> a function comes from.
>
> Checking an error description is fairly trivial and something that 
> each test case can handle as needed.

The above statements which were moved are not used in the test cases, 
these were part of try_assoc() and try_getinstance() function in the 
library common_util.py.
Also, something similar was needed by the try_request_state_change() 
function that I added to the common_util.py.
I have just moved the repeating code to verify_err_desc().

Thanks and Regards,
Deepti.





More information about the Libvirt-cim mailing list