[Libvirt-cim] [PATCH] [TEST] Update VSMS 04_definesystem_ers.py to use cim_define()

Kaitlin Rupert kaitlin at linux.vnet.ibm.com
Thu Jan 8 23:26:20 UTC 2009


>> -    if rc != PASS:
>> -        logger.error('DefineSystem should NOT return OK with a wrong 
>> ss input')
>> +        if cxml.err_desc.find(exp_desc) < 0:
>> +            raise Exception("Got desc: '%s', exp '%s'" % 
>> (cxml.err_desc, +                            exp_desc))
>>
>>   
> How about including the above checks for err_rc and err_desc in the 
> cim_define() like the way we have in create_using_definesystem().
> This would avoid repeating this check in every test which verifies the 
> error conditions.

I purposefully didn't add this to cim_define() because I think that 
overloads the purpose of the cim_define() function.

We don't need to very the error condition very often and it causes the 
cim_define() function to be more bloated than need be.

I can make this a separate function if you'd like, which is honestly 
probably a better approach than what I have here.  If you use a 
function, you don't have to access the elements of the VirtCIM class 
directly.

I'll work up a new patch with a function for this.  Thanks for bringing 
it up. =)

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




More information about the Libvirt-cim mailing list