Blob Blame History Raw
From 8ba3872256d3daf72b4fad4b08115965f0b9243e Mon Sep 17 00:00:00 2001
From: Giuseppe Scrivano <gscrivan@redhat.com>
Date: Fri, 1 Nov 2013 18:37:38 +0100
Subject: [RHEL-7.0 virt-manager PATCH] LVM: Show warning when allocation==0
 and allocation != capacity

RHEL-7 only.

commit aff0ddb2594cea6d0683659e059e4f3a35f0437e fixes this problem
upstream as a side effect of a refactoring.

Closes: bz#1021789

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

diff --git a/virtinst/Storage.py b/virtinst/Storage.py
index 1dc1768..dffc382 100644
--- a/virtinst/Storage.py
+++ b/virtinst/Storage.py
@@ -1379,7 +1379,7 @@ class LogicalVolume(StorageVolume):

     def __init__(self, name, capacity, pool=None, pool_name=None, conn=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, name=name, pool=pool, pool_name=pool_name,
-- 
1.8.4.2