[PATCH] Remove a wrong RAM/swap check (#1123466)

Vratislav Podzimek vpodzime at redhat.com
Sun Jul 27 14:04:05 UTC 2014


If user doesn't create any swap partitions, Anaconda may require more RAM to
install packages. But the amount of RAM depends on the installation mode
(GUI/TUI) and such check should be in the Anaconda not blivet. Let's start with
removing the check and hot-fixing the bug.

Signed-off-by: Vratislav Podzimek <vpodzime at redhat.com>
---
 blivet/__init__.py | 24 +++++-------------------
 1 file changed, 5 insertions(+), 19 deletions(-)

diff --git a/blivet/__init__.py b/blivet/__init__.py
index f8e8ac3..ff77b53 100644
--- a/blivet/__init__.py
+++ b/blivet/__init__.py
@@ -28,7 +28,6 @@ __version__ = '0.61'
 ## in question or care must be taken so they are imported only after
 ## enable_installer_mode is called.
 ##
-isys = None
 iutil = None
 ROOT_PATH = '/'
 _storageRoot = ROOT_PATH
@@ -102,7 +101,6 @@ log = logging.getLogger("blivet")
 
 def enable_installer_mode():
     """ Configure the module for use by anaconda (OS installer). """
-    global isys
     global iutil
     global ROOT_PATH
     global _storageRoot
@@ -113,7 +111,6 @@ def enable_installer_mode():
     global errorHandler
     global ERROR_RAISE
 
-    from pyanaconda import isys # pylint: disable=redefined-outer-name
     from pyanaconda import iutil # pylint: disable=redefined-outer-name
     from pyanaconda.constants import shortProductName # pylint: disable=redefined-outer-name
     from pyanaconda.constants import productName # pylint: disable=redefined-outer-name
@@ -1689,22 +1686,11 @@ class Blivet(object):
                                     "'biosboot' type partition.")))
 
         if not swaps:
-            installed = util.total_memory()
-            required = Size("%s KiB" % isys.EARLY_SWAP_RAM)
-
-            if installed < required:
-                exns.append(
-                   SanityError(_("You have not specified a swap partition.  "
-                                "%(requiredMem)s of memory is required to continue installation "
-                                "without a swap partition, but you only have %(installedMem)s.")
-                              % {"requiredMem": required,
-                                 "installedMem": installed}))
-            else:
-                exns.append(
-                   SanityWarning(_("You have not specified a swap partition.  "
-                                  "Although not strictly required in all cases, "
-                                  "it will significantly improve performance "
-                                  "for most installations.")))
+            exns.append(
+                SanityWarning(_("You have not specified a swap partition.  "
+                                "Although not strictly required in all cases, "
+                                "it will significantly improve performance "
+                                "for most installations.")))
         no_uuid = [s for s in swaps if s.format.exists and not s.format.uuid]
         if no_uuid:
             exns.append(
-- 
1.9.3



More information about the anaconda-patches mailing list