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

[PATCH] Fix up swap unmount logic (#708966)



swap was always being unmounted, even when swapoff == False
---
 pyanaconda/storage/__init__.py |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/pyanaconda/storage/__init__.py b/pyanaconda/storage/__init__.py
index 9904581..b183471 100644
--- a/pyanaconda/storage/__init__.py
+++ b/pyanaconda/storage/__init__.py
@@ -2149,14 +2149,15 @@ class FSSet(object):
         self.active = True
 
     def umountFilesystems(self, ignoreErrors=True, swapoff=True):
+        """ unmount filesystems, except swap if swapoff == False """
         devices = self.mountpoints.values() + self.swapDevices
         devices.extend([self.dev, self.devshm, self.devpts, self.sysfs,
                         self.proc, self.usb, self.selinux])
         devices.sort(key=lambda d: getattr(d.format, "mountpoint", None))
         devices.reverse()
         for device in devices:
-            if not device.format.mountable and \
-               (device.format.type != "swap" or swapoff):
+            if (not device.format.mountable) or \
+               (device.format.type == "swap" and not swapoff):
                 continue
 
             device.format.teardown()
-- 
1.7.4.4


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