[Libvirt-cim] [PATCH] [TEST] add a try..except to get_value_xpath()

Zhengang Li zli at linux.vnet.ibm.com
Wed Apr 9 10:37:19 UTC 2008


Deepti B Kalakeri wrote:


>>
>>      def get_value_xpath(self, xpathStr):
>> -        node = self.get_node(xpathStr)
>> +        try:
>> +            node = self.get_node(xpathStr)
>> +        except LoopUpError:
>>   
> I think this should be *LookUpError.*
>> +            raise Exception('Zero or multiple node found')
>>   
> And can we use logger.error instead, I guess using raise statement does 
> not proceed with the execution of the next stmt after it, right ??
> In that case the return None wont be of much use.
> **
Agree. Logger is better.


-- 
- Zhengang




More information about the Libvirt-cim mailing list