[virt-tools-list] [virt-manager PATCH] virtinst.storage: check _pool_xml before using it

Pavel Hrdina phrdina at redhat.com
Tue May 16 14:59:13 UTC 2017


Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1450311

Signed-off-by: Pavel Hrdina <phrdina at redhat.com>
---
 virtinst/storage.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/virtinst/storage.py b/virtinst/storage.py
index a6963d50..66201efc 100644
--- a/virtinst/storage.py
+++ b/virtinst/storage.py
@@ -698,7 +698,9 @@ class StorageVolume(_StorageObject):
                 return self.TYPE_DIR
             elif self.type == "network":
                 return self.TYPE_NETWORK
-        return self._pool_xml.get_disk_type()
+        if self._pool_xml:
+            return self._pool_xml.get_disk_type()
+        return None
     file_type = property(_get_vol_type)
 
 
-- 
2.13.0




More information about the virt-tools-list mailing list