On 05/25/2012 09:52 PM, Chris Evich wrote:
> On 05/25/2012 06:26 AM, Alex Jia wrote:
>> IMHO, we should reuse virsh_dumpxml() then give a optional 'to_file'
>> parameter rather than defining many similar function, for example,
>>
>> def virsh_dumpxml(name, to_file="", uri="")
>> if to_file:
>> cmd = "dumpxml %s> %s" % (name, to_file)
>> else:
>> cmd = "dumpxml %s" % name
>>
>> return virsh_cmd(cmd, uri)
>
> I like this idea.
>
>>
>> And then I saw each virsh cmd need to deal with exception case,
>> we should do it in virsh_cmd() to simplify codes.
>
> I don't quite understand your meaning here, could you explain further?
>
virsh_cmd() is a common function and will run all of virsh cmds by
utils.run() then
it just returns stdout now, a caller will do result check and catch a
error further,
if we can put these work in virsh_cmd(), I think it will simplify our codes.
_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest