[PATCH 1/2] Handle roots with or without trailing "/" in FileDevice.path. (#541473)

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

 



---
 storage/devices.py |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/storage/devices.py b/storage/devices.py
index b4a518e..7b2e30c 100644
--- a/storage/devices.py
+++ b/storage/devices.py
@@ -2997,7 +2997,11 @@ class FileDevice(StorageDevice):
             root = self.parents[0].format._mountpoint
             # trim the mountpoint down to the chroot since we already have
             # the otherwise fully-qualified path
-            root = root[:-len(self.parents[0].format.mountpoint)]
+            mountpoint = self.parents[0].format.mountpoint
+            if mountpoint.endswith("/"):
+                mountpoint = mountpoint[:-1]
+            if mountpoint:
+                root = root[:-len(mountpoint)]
 
         return os.path.normpath("%s/%s" % (root, path))
 
-- 
1.6.5.2

_______________________________________________
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