[PATCH] virtinst: correctly check if "allocation" is None

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

 



Just checking "allocation" instead of "allocation is not None"
inhibits the warning message when "allocation == 0".

Related to bz 1000980.

Signed-off-by: Giuseppe Scrivano <gscrivan@xxxxxxxxxx>
---
 virtinst/storage.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/virtinst/storage.py b/virtinst/storage.py
index e0b0ef1..b2727ba 100644
--- a/virtinst/storage.py
+++ b/virtinst/storage.py
@@ -1363,7 +1363,7 @@ class LogicalVolume(StorageVolume):
     def __init__(self, conn,
                  name, capacity, pool=None, pool_name=None,
                  allocation=None, perms=None):
-        if allocation and allocation != capacity:
+        if allocation is not None and allocation != capacity:
             logging.warn(_("Sparse logical volumes are not supported, "
                            "setting allocation equal to capacity"))
         StorageVolume.__init__(self, conn, name=name,
-- 
1.8.3.1

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




[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux