def check_memory(anaconda, opts, display_mode=None):
- reason_strict = _('You do not have enough RAM to install %s '
- 'on this machine.
' % product.productName)
- reason_method = _('You do not have enough RAM to install %s '
- 'on this machine using this install method.
' %
- product.productName)
- reason_graphical = _('You do not have enough RAM to use the graphical '
- 'installer.')
+ reason_strict = _("%s requires %s MB of memory to install, but you only have "
+ "%s MB on this machine.
")
+ reason_method = _("%s requires %s MB of memory to install using this "
+ "installation method, but you only have %s MB on this "
+ "machine.
")
+ reason_graphical = _("The %s graphical installer requires %s MB of memory, but "
+ "you only have %s MB.")
+
reboot_extra = _('
'
'Press <return> to reboot your system.
')
livecd_title = _("Not enough RAM")
@@ -348,38 +349,38 @@ def check_memory(anaconda, opts, display_mode=None):
extra_ram += isys.URL_INSTALL_EXTRA_RAM
reason = reason_method
# override display mode if machine cannot nicely run X
if display_mode not in ('t', 'c') and not flags.usevnc:
- needed_ram += isys.GUI_INSTALL_EXTRA_RAM
+ needed_ram += int(isys.GUI_INSTALL_EXTRA_RAM / 1024)
reason = reason_graphical
/* make sure they have enough ram */
static void checkForRam(int install_method) {
- char *reason_none = _("You do not have enough RAM to install %s on this machine.");
- char *reason_method = _("You do not have enough RAM to install %s on this machine using this install method.");
+ char *reason_none = _("%s requires %d MB of memory, to install, but you only have %d MB.");
+ char *reason_method = _("%s requires %d MB of memory to install using this installation "
+ "method, but you only have %d MB on this machine.");
char* reason = reason_none;
int needed = MIN_RAM;
+ int installed = totalMemory();
if not swaps:
- if iutil.memInstalled() < isys.EARLY_SWAP_RAM:
+ from pyanaconda.storage.size import Size
+
+ installed = Size(spec="%s kb" % iutil.memInstalled())
+ required = Size(spec="%s kb" % isys.EARLY_SWAP_RAM)
+
+ if installed < required:
errors.append(_("You have not specified a swap partition. "
- "Due to the amount of memory present, a "
- "swap partition is required to complete "
- "installation."))
+ "%s MB of memory is required to continue installation "
+ "without a swap partition, but you only have %s MB.")
+ % (int(required.convertTo(spec="MB")), int(installed.convertTo(spec="MB"))))
else:
warnings.append(_("You have not specified a swap partition. "
"Although not strictly required in all cases, "
--
1.7.1.1
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list