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

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



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 oneshoeco com>

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()

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