summaryrefslogtreecommitdiffstats
path: root/fsset.py
diff options
context:
space:
mode:
authorChris Lumens <clumens@redhat.com>2007-07-19 14:19:21 +0000
committerChris Lumens <clumens@redhat.com>2007-07-19 14:19:21 +0000
commitc131ec0b3b2a9afd5e06b93a0efa8609e6a6513e (patch)
tree20bded32ca33efe7922a393a2244d443dea8f21d /fsset.py
parentdd4f6647d364678d8d0d60e168e3876ef172b84f (diff)
downloadanaconda-c131ec0b3b2a9afd5e06b93a0efa8609e6a6513e.tar.gz
anaconda-c131ec0b3b2a9afd5e06b93a0efa8609e6a6513e.tar.xz
anaconda-c131ec0b3b2a9afd5e06b93a0efa8609e6a6513e.zip
Fix duplicate entry check to take multiple bind mounts into account (#246424).
Diffstat (limited to 'fsset.py')
-rw-r--r--fsset.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/fsset.py b/fsset.py
index eea810698..f3d021722 100644
--- a/fsset.py
+++ b/fsset.py
@@ -1162,12 +1162,20 @@ class FileSystemSet:
return True
return False
+ def samePseudo (a, b):
+ return isinstance(a.fsystem, PsudoFileSystem) and isinstance (b.fsystem, PsudoFileSystem) and \
+ not isinstance (a.fsystem, BindFileSystem) and not isinstance (b.fsystem, BindFileSystem) and \
+ a.fsystem.getName() == b.fsystem.getName()
+
+ def sameEntry (a, b):
+ return a.device.getDevice() == b.device.getDevice() and a.mountpoint == b.mountpoint
+
# Remove preexisting duplicate entries - pseudo filesystems are
# duplicate if they have the same filesystem type as an existing one.
# Otherwise, they have to have the same device and mount point
# (required to check for bind mounts).
for existing in self.entries:
- if (isinstance (newEntry.fsystem, PsudoFileSystem) and existing.fsystem.getName() == newEntry.fsystem.getName()) or (existing.device.getDevice() == newEntry.device.getDevice() and existing.mountpoint == newEntry.mountpoint):
+ if samePseudo (newEntry, existing) or sameEntry (newEntry, existing):
self.remove(existing)
# XXX debuggin'