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

Kaitlin Rupert kaitlin at linux.vnet.ibm.com
Thu Jul 31 13:46:02 UTC 2008


Deepti B Kalakeri wrote:
> 
> 
> 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().
> 

Ah, oops.  My mistake.  That's fine then.  Ignore my original comment. =)

-- 
Kaitlin Rupert
IBM Linux Technology Center
kaitlin at linux.vnet.ibm.com




More information about the Libvirt-cim mailing list