[PATCH 13/13] Prevent duplicate mountpoint creation.

David Lehman dlehman at redhat.com
Wed Aug 29 00:00:52 UTC 2012


This is absolutely minimal handling for the immediate term and
will be replaced soon by proper handling within the AddDialog.
---
 pyanaconda/ui/gui/spokes/custom.py |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py
index 5ce6624..f0e8d58 100644
--- a/pyanaconda/ui/gui/spokes/custom.py
+++ b/pyanaconda/ui/gui/spokes/custom.py
@@ -965,7 +965,11 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
         if mountpoint.lower() == "swap":
             mountpoint = None
 
-        # TODO: validate the mountpoint for sanity and uniqueness
+        # TODO: validate the mountpoint for sanity
+        if mountpoint in self.__storage.mountpoints:
+            # FIXME: do this in the add dialog
+            log.error("ignoring request to create duplicate %s" % mountpoint)
+            return
 
         device_type = self.data.autopart.type
         if device_type == AUTOPART_TYPE_LVM and \
-- 
1.7.7.6



More information about the anaconda-patches mailing list