[PATCH] Pass anaconda to turnOnSwap so we can use swap files.

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

 



For swap files we need to know anaconda.rootPath and since we're also
using anaconda.intf it seems like time to just give in and pass anaconda.
---
 packages.py         |    2 +-
 rescue.py           |    2 +-
 storage/__init__.py |   10 +++++-----
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/packages.py b/packages.py
index a7f5e32..275c7c7 100644
--- a/packages.py
+++ b/packages.py
@@ -193,7 +193,7 @@ def turnOnFilesystems(anaconda):
                 sys.exit(1)
 
         if not anaconda.id.upgrade:
-            anaconda.id.storage.fsset.turnOnSwap(anaconda.intf)
+            anaconda.id.storage.fsset.turnOnSwap(anaconda)
             anaconda.id.storage.fsset.mountFilesystems(anaconda,
                                                        raiseErrors=False,
                                                        readOnly=False,
diff --git a/rescue.py b/rescue.py
index 707f3be..f34a77c 100644
--- a/rescue.py
+++ b/rescue.py
@@ -327,7 +327,7 @@ def runRescue(anaconda, instClass):
                 # now turn on swap
                 if not readOnly:
                     try:
-                        anaconda.id.storage.fsset.turnOnSwap(anaconda.intf)
+                        anaconda.id.storage.fsset.turnOnSwap(anaconda)
                     except:
                         log.error("Error enabling swap")
 
diff --git a/storage/__init__.py b/storage/__init__.py
index 9a1999e..519ac98 100644
--- a/storage/__init__.py
+++ b/storage/__init__.py
@@ -1479,13 +1479,13 @@ class FSSet(object):
                                         options)
         return mtab
 
-    def turnOnSwap(self, intf=None, upgrading=None):
+    def turnOnSwap(self, anaconda, upgrading=None):
         for device in self.swapDevices:
             try:
                 device.setup()
                 device.format.setup()
             except SuspendError:
-                if intf:
+                if anaconda.intf:
                     if upgrading:
                         msg = _("The swap device:\n\n     %s\n\n"
                                 "in your /etc/fstab file is currently in "
@@ -1504,10 +1504,10 @@ class FSSet(object):
                                 "to format all swap devices.") \
                               % device.path
 
-                    intf.messageWindow(_("Error"), msg)
+                    anaconda.intf.messageWindow(_("Error"), msg)
                 sys.exit(0)
             except DeviceError as (msg, path):
-                if intf:
+                if anaconda.intf:
                     if upgrading:
                         err = _("Error enabling swap device %s: %s\n\n"
                                 "The /etc/fstab on your upgrade partition "
@@ -1520,7 +1520,7 @@ class FSSet(object):
                                 "device has not been initialized.\n\n"
                                 "Press OK to exit the installer.") % \
                               (path, msg)
-                    intf.messageWindow(_("Error"), err)
+                    anaconda.intf.messageWindow(_("Error"), err)
                 sys.exit(0)
 
     def mountFilesystems(self, anaconda, raiseErrors=None, readOnly=None,
-- 
1.6.0.6

_______________________________________________
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