[PATCH] Fix lookup pool by path

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

 



Hi,

attached is a patch for virtinst to fix the lookup_pool_by_path() function. It 
removes the trailing slash to have a normalized path.


Cheers,


  -- andreas

-- 
Andreas Schneider, SUSE Labs, http://www.suse.de/
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg)
Index: virtinst-0.400.0/virtinst/util.py
===================================================================
--- virtinst-0.400.0.orig/virtinst/util.py
+++ virtinst-0.400.0/virtinst/util.py
@@ -455,7 +455,8 @@ def lookup_pool_by_path(conn, path):
     pool_list = conn.listStoragePools() + conn.listDefinedStoragePools()
     for name in pool_list:
         pool = conn.storagePoolLookupByName(name)
-        if get_xml_path(pool.XMLDesc(0), "/pool/target/path") == path:
+        xml_path = get_xml_path(pool.XMLDesc(0), "/pool/target/path")
+        if os.path.dirname(xml_path) == path:
             return pool
     return None
 

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/et-mgmt-tools

[Index of Archives]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux