On 07/13/2012 05:50 AM, Yu Mingfei wrote:
> This patch adds functions about network to virt/libvirt_vm.py.
>
> Signed-off-by: Yu Mingfei <yuming...@cn.fujitsu.com>
> ---
>   client/virt/libvirt_vm.py |   24 ++++++++++++++++++++++++
>   1 files changed, 24 insertions(+), 0 deletions(-)
>
> diff --git a/client/virt/libvirt_vm.py b/client/virt/libvirt_vm.py
> index 9a06f05..8a478fd 100644
> --- a/client/virt/libvirt_vm.py
> +++ b/client/virt/libvirt_vm.py
> @@ -520,6 +520,30 @@ def virsh_detach_interface(name, option="", uri="",
> ignore_status=False, print_i
>       return virsh_cmd(cmd, uri, ignore_status, print_info)
>
>
> +def virsh_net_create(xml_file, extra="", uri="", ignore_status=False,
> print_info=False):
> +    """
> +    Create network from a XML file.
> +    """
> +    cmd = "net-create --file %s %s" % (xml_file, extra)
> +    return virsh_cmd(cmd, uri, ignore_status, print_info)
> +
> +

This function looks good.  Only suggestion is make sure to wrap the 
header so it's less than 80 characters, i.e.:

def virsh_net_create(xml_file, extra="", uri="",
                      ignore_status=False, print_info=False):

> +def virsh_net_list(options, extra="", uri="", ignore_status=False,
> print_info=False):
> +    """
> +    List networks on host.
> +    """
> +    cmd = "net-list %s %s" % (options, extra)
> +    return virsh_cmd(cmd, uri, ignore_status, print_info)
> +
> +
> +def virsh_net_destroy(name, extra="", uri="", ignore_status=False,
> print_info=False):
> +    """
> +    Destroy actived network on host.
> +    """
> +    cmd = "net-destroy --network %s %s" % (name, extra)
> +    return virsh_cmd(cmd, uri, ignore_status, print_info)
> +
> +
>   class VM(virt_vm.BaseVM):
>       """
>       This class handles all basic VM operations for libvirt.
> --
> 1.7.1
>
>
> --
> Best Regards
> Yu Mingfei
>

This code all looks good to me, it's nice and simple, generally follows 
style, and I don't spot any mistakes.  I will double-check after lunch, 
fix line-wrap, and commit to next branch for you.  Nice job.

-- 
Chris Evich, RHCA, RHCE, RHCDS, RHCSS
Quality Assurance Engineer
e-mail: cevich + `@' + redhat.com o: 1-888-RED-HAT1 x44214
_______________________________________________
Autotest mailing list
Autotest@test.kernel.org
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

Reply via email to