[Kimchi-devel] [PATCH v3 2/5] Handle invalid path in 'get_disk_ref_cnt'

Crístian Deives cristiandeives at gmail.com
Tue May 12 14:58:39 UTC 2015


Signed-off-by: Crístian Deives <cristiandeives at gmail.com>
---
 src/kimchi/model/diskutils.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/kimchi/model/diskutils.py b/src/kimchi/model/diskutils.py
index 1d575cb..97fc9d9 100644
--- a/src/kimchi/model/diskutils.py
+++ b/src/kimchi/model/diskutils.py
@@ -34,7 +34,7 @@ def get_disk_ref_cnt(objstore, conn, path):
         with objstore as session:
             try:
                 ref_cnt = session.get('storagevolume', path)['ref_cnt']
-            except NotFoundError:
+            except (KeyError, NotFoundError):
                 kimchi_log.info('Volume %s not found in obj store.' % path)
                 ref_cnt = 0
                 # try to find this volume in existing vm
-- 
2.1.0




More information about the Kimchi-devel mailing list