From eb92178e0c208c20c658dd3f38caf377bb788ae4 Mon Sep 17 00:00:00 2001 From: Charles Arnold Date: Wed, 12 Aug 2015 16:00:14 -0600 Subject: [PATCH] storage: fix default storage pool lookup virt-convert fails when the storage pool is already present but is not called 'default'. If the 'default' pool has been removed but another pool uses the default location of /var/lib/libvirt/images virt-convert will fail to find the pool and attempt to create another one with the same path. This causes the conversion to fail. Signed-off-by: Charles Arnold (crobinso: Remove now-redundant 'pass') --- virtinst/storage.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/virtinst/storage.py b/virtinst/storage.py index 285acb84..d3d867ad 100644 --- a/virtinst/storage.py +++ b/virtinst/storage.py @@ -209,10 +209,12 @@ class StoragePool(_StorageObject): try: pool = conn.storagePoolLookupByName(name) except libvirt.libvirtError: - pass + # Try default pool path when "default" name fails + pool = StoragePool.lookup_pool_by_path(conn, path) if pool: - return + # This is a libvirt pool object so create a StoragePool from it + return StoragePool(conn, parsexml=pool.XMLDesc(0)) try: logging.debug("Attempting to build default pool with target '%s'",