On 05/24/2012 10:41 PM, guyanhua wrote:
>
> Add virsh nodeinfo function to libvirt_vm.
>
> Signed-off-by: Gu Yanhua<[email protected]>
> ---
> 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)
>
It would be nice if virsh_nodeinfo() accepted a keyword uri="" option
like the other virsh_*() functions. This would make it more generally
useful if ever we want to test remote libvirt also.
> +def virsh_nodeinfo(option):
> + """
> + Returns basic information about the node
> + """
> + cmd = "virsh nodeinfo %s" % option
> + cmd_result = utils.run(cmd, ignore_status=True)
Here, I think you can re-use the virsh_cmd() function instead of
utils.run(), no?
> + 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
> [email protected]
> http://test.kernel.org/cgi-bin/mailman/listinfo/autotest
--
Chris Evich, RHCA, RHCE, RHCDS, RHCSS
Quality Assurance Engineer
e-mail: cevich + `@' + redhat.com o: 1-888-RED-HAT1 x44214
_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest