+1

Sharad Mishra
System x Enablement
Linux Technology Center
IBM

Inactive hide details for Kaitlin Rupert ---11/20/2009 12:49:05 PM---# HG changeset patchKaitlin Rupert ---11/20/2009 12:49:05 PM---# HG changeset patch

          Kaitlin Rupert <kaitlin@linux.vnet.ibm.com>
          Sent by: libvirt-cim-bounces@redhat.com

          11/20/2009 12:55 PM
          Please respond to
          List for discussion and development of libvirt CIM <libvirt-cim@redhat.com>


To

libvirt-cim@redhat.com

cc


Subject

[Libvirt-cim] [PATCH] [TEST] Change create_diskpool() to use virsh pool-info

# HG changeset patch
# User Kaitlin Rupert <karupert@us.ibm.com>
# Date 1258750445 28800
# Node ID 269167924d0e969ff190fde80596033c28f414a7
# Parent  ed3a9593a2acb7fc7ac124666d873d51e3c315fd
[TEST] Change create_diskpool() to use virsh pool-info

Instead of checking the output of pool-list.  pool-info will return a error if
the guest isn't found.  You can run into a problem checking the output of
virsh pool-list is libvirt returns extra debug messages (etc).

Signed-off-by: Kaitlin Rupert <karupert@us.ibm.com>

diff -r ed3a9593a2ac -r 269167924d0e suites/libvirt-cim/lib/XenKvmLib/common_util.py
--- a/suites/libvirt-cim/lib/XenKvmLib/common_util.py Thu Nov 19 03:51:03 2009 -0800
+++ b/suites/libvirt-cim/lib/XenKvmLib/common_util.py Fri Nov 20 12:54:05 2009 -0800
@@ -341,10 +341,9 @@
                dpoolname=dpool_list[0]

        if dpoolname == None:
-            cmd = "virsh -c %s pool-list --all | grep %s" % \
-                  (virt2uri(virt), dpool)
+            cmd = "virsh -c %s pool-info %s" % (virt2uri(virt), dpool)
            ret, out = utils.run_remote(server, cmd)
-            if out != "":
+            if ret == 0:
                logger.error("Disk pool with name '%s' already exists", dpool)
                return FAIL, "Unknown"


_______________________________________________
Libvirt-cim mailing list
Libvirt-cim@redhat.com
https://www.redhat.com/mailman/listinfo/libvirt-cim