mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-02-25 17:57:34 +03:00
Fix logical volume tests
After commit 590c8dbebfddb71874de7a98e579264ebae6859f, the tests got broken due to the fact that the commit broke something that was working. I'm changing the error to warning and fixing the tests. Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
parent
d0a76f3905
commit
212b77cc1f
@ -1,7 +1,7 @@
|
||||
<volume>
|
||||
<name>pool-logical-vol</name>
|
||||
<capacity>10737418240</capacity>
|
||||
<allocation>5368709120</allocation>
|
||||
<allocation>10737418240</allocation>
|
||||
<target>
|
||||
<permissions>
|
||||
<mode>0700</mode>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<source>
|
||||
</source>
|
||||
<capacity unit="bytes">10737418240</capacity>
|
||||
<allocation unit="bytes">5368709120</allocation>
|
||||
<allocation unit="bytes">10737418240</allocation>
|
||||
<target>
|
||||
<path>/some/target/path/pool-logical-vol</path>
|
||||
<permissions>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<volume>
|
||||
<name>pool-logical-volinput</name>
|
||||
<capacity>10737418240</capacity>
|
||||
<allocation>5368709120</allocation>
|
||||
<allocation>10737418240</allocation>
|
||||
<target>
|
||||
<permissions>
|
||||
<mode>0700</mode>
|
||||
|
@ -1350,8 +1350,8 @@ class LogicalVolume(StorageVolume):
|
||||
def __init__(self, name, capacity, pool=None, pool_name=None, conn=None,
|
||||
allocation=None, perms=None):
|
||||
if allocation and allocation != capacity:
|
||||
raise ValueError(_("Sparse logical volumes are not supported, "
|
||||
"allocation must be equal to 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,
|
||||
allocation=capacity, capacity=capacity,
|
||||
conn=conn)
|
||||
@ -1365,9 +1365,9 @@ class LogicalVolume(StorageVolume):
|
||||
|
||||
def set_allocation(self, allocation):
|
||||
if allocation != self.capacity:
|
||||
raise ValueError(_("Sparse logical volumes are not supported, "
|
||||
"allocation must be equal to capacity"))
|
||||
super(LogicalVolume, self).set_allocation(allocation)
|
||||
logging.warn(_("Sparse logical volumes are not supported, "
|
||||
"setting allocation equal to capacity"))
|
||||
super(LogicalVolume, self).set_allocation(self.capacity)
|
||||
capacity = property(StorageVolume.get_allocation, set_allocation)
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user