[virt-tools-list] [virt-manager PATCH 2/2] virt-manager, details: properly check for pool presence

Giuseppe Scrivano gscrivan at redhat.com
Fri Oct 10 09:16:37 UTC 2014


commit 5e8f35f5e6d2f86a6846e3725885980eb51a5eae introduced this
problem.

Signed-off-by: Giuseppe Scrivano <gscrivan at redhat.com>
---
 virtManager/details.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/virtManager/details.py b/virtManager/details.py
index 3a20b75..38dfeca 100644
--- a/virtManager/details.py
+++ b/virtManager/details.py
@@ -2586,9 +2586,11 @@ class vmmDetails(vmmGObjectUI):
             size = "-"
         else:
             if source_pool:
-                pool = self.conn.get_pool(source_pool)
-                if pool:
+                try:
+                    pool = self.conn.get_pool(source_pool)
                     vol = pool.get_volume(path)
+                except KeyError:
+                    vol = None
             else:
                 vol = self.conn.get_vol_by_path(path)
 
-- 
1.9.3




More information about the virt-tools-list mailing list