On 05/25/2012 10:41 AM, guyanhua wrote:
>
> Add virsh nodeinfo function to libvirt_vm.
>
> Signed-off-by: Gu Yanhua <guyanhua-f...@cn.fujitsu.com>
> ---
>  client/virt/libvirt_vm.py |   11 +++++++++++
>  1 files changed, 11 insertions(+), 0 deletions(-)
>  mode change 100644 => 100755 client/virt/libvirt_vm.py
>
> diff --git a/client/virt/libvirt_vm.py b/client/virt/libvirt_vm.py
> old mode 100644
> new mode 100755
> index eda5e8e..2e12d84
> --- a/client/virt/libvirt_vm.py
> +++ b/client/virt/libvirt_vm.py
> @@ -85,6 +85,17 @@ def service_libvirtd_control(action):
>      else:
>          raise error.TestError("Unknown action: %s" % action)
>
> +def virsh_nodeinfo(option):
> +    """
> +    Returns basic information about the node
> +    """
> +    cmd = "virsh nodeinfo  %s" % option
> +    cmd_result = utils.run(cmd, ignore_status=True)
Please refer to other virsh_*() implementation, you should call 
virsh_cmd() rather than
utils.run(), the virsh_cmd() will call utils.run(), then if virsh_cmd() 
is not enough, please
improve it, thanks.
> +    logging.info("Output: %s", cmd_result.stdout.strip())
> +    logging.error("Error: %s", cmd_result.stderr.strip())
> +    logging.info("Status: %d", cmd_result.exit_status)
> +    return cmd_result.exit_status, cmd_result.stdout.strip()
> +
>
>  def virsh_cmd(cmd, uri = ""):
>      """
> -- 
> 1.7.1
>

_______________________________________________
Autotest mailing list
Autotest@test.kernel.org
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

Reply via email to