[PATCH 3/7] Don't allow reformat without setting a mountpoint. (#883076)

David Lehman dlehman at redhat.com
Wed Dec 5 23:45:30 UTC 2012


diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py
index c1b6064..f53d8c7 100644
--- a/pyanaconda/ui/gui/spokes/custom.py
+++ b/pyanaconda/ui/gui/spokes/custom.py
@@ -940,8 +940,13 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
         old_mountpoint = getattr(device.format, "mountpoint", "") or ""
         log.debug("old mountpoint: %s" % old_mountpoint)
         log.debug("new mountpoint: %s" % mountpoint)
-        if mountpoint is not None and mountpoint != old_mountpoint:
-            error = validate_mountpoint(mountpoint, self.__storage.mountpoints.keys())
+        if mountpoint is not None and (reformat or
+                                       mountpoint != old_mountpoint):
+            mountpoints = self.__storage.mountpoints.copy()
+            if old_mountpoint:
+                del mountpoints[old_mountpoint]
+
+            error = validate_mountpoint(mountpoint, mountpoints.keys())
             if error:
                 self._error = _(mountpoint_validation_msgs[error])
                 self.set_warning(self._error)
-- 
1.7.7.6



More information about the anaconda-patches mailing list