[PATCH] virt-install: don't fail on storage pools without targets.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi list,

Not sure what is your preferred method to receive patches.  See attached
for a minor bug fix, also available at:
  https://github.com/tomlanyon/python-virtinst/commit/bad518b15dd5b4858f4fb99837ce54b30f1bcfb6

This fixes a failure when using CLI virt-install (and potentially virtinst
in other places) when libvirt is configured with storage pools which have
no <target> elements; an example of this is the 'rbd' pool type.

If committed, please use Author: Tom Lanyon <tom@xxxxxxxxxxxxx>

Regards,
Tom

---
virtinst/util.py |    2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/virtinst/util.py b/virtinst/util.py
index 38a04c8..d012692 100644
--- a/virtinst/util.py
+++ b/virtinst/util.py
@@ -545,7 +545,7 @@ def lookup_pool_by_path(conn, path):
     def check_pool(poolname, path):
         pool = conn.storagePoolLookupByName(poolname)
         xml_path = get_xml_path(pool.XMLDesc(0), "/pool/target/path")
-        if os.path.abspath(xml_path) == path:
+        if xml_path is not None and os.path.abspath(xml_path) == path:
             return pool
 
     running_list = conn.listStoragePools()
_______________________________________________
virt-tools-list mailing list
virt-tools-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/virt-tools-list

[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux