[PATCH 2/3] Check if LVs still fit when removing a PV from a VG. (#682276)

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

 



---
 pyanaconda/iw/lvm_dialog_gui.py |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/pyanaconda/iw/lvm_dialog_gui.py b/pyanaconda/iw/lvm_dialog_gui.py
index cd76c9b..886dc13 100644
--- a/pyanaconda/iw/lvm_dialog_gui.py
+++ b/pyanaconda/iw/lvm_dialog_gui.py
@@ -48,6 +48,11 @@ class VolumeGroupEditor:
                                   parents=pvs, peSize=self.peSize)
         vg.voriginSnapshots = self.vg.voriginSnapshots.copy()
         for lv in self.lvs.values():
+            # this used to get checked in the LV ctor, but no more if the
+            # PVs are growable because of kickstart's odd sequencing
+            if lv['size'] > vg.freeSpace:
+                raise ValueError("not enough space in VG")
+
             _l = LVMLogicalVolumeDevice(lv['name'], vg, format=lv['format'],
                                    size=lv['size'], exists=lv['exists'],
                                    stripes=lv['stripes'],
@@ -301,7 +306,7 @@ class VolumeGroupEditor:
             self.pvs.remove(pv)
             try:
                 vg = self.getTempVG()
-            except DeviceError as e:
+            except ValueError as e:
                 self.intf.messageWindow(_("Not enough space"),
                                     _("You cannot remove this physical "
                                       "volume because otherwise the "
-- 
1.7.3.4

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux