[f20-branch][PATCH] If an invalid size is given, reset the entry to the old value (#1021511)

Vratislav Podzimek vpodzime at redhat.com
Tue Oct 22 09:47:25 UTC 2013


I user gives us e.g. a too small size for a mountpoint, we should reset the
entry to the old value. That gives a feedback that it was not possible to do the
change.

Signed-off-by: Vratislav Podzimek <vpodzime at redhat.com>
---
 pyanaconda/ui/gui/spokes/custom.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py
index 48e58e7..6131048 100644
--- a/pyanaconda/ui/gui/spokes/custom.py
+++ b/pyanaconda/ui/gui/spokes/custom.py
@@ -1454,6 +1454,9 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
                         self.set_warning(_("Device resize request failed. "
                                            "Click for details."))
                         self.window.show_all()
+                    except ValueError as e:
+                        log.error("failed to resize device %s to %s: %s" % (device.name, size, e))
+                        self._sizeEntry.set_text(str(old_size))
                     else:
                         log.debug("%r", device)
                         log.debug("new size: %s", device.size)
-- 
1.7.11.7



More information about the anaconda-patches mailing list