Re: [PATCH 2/2] Add nomemcheck to anaconda (#708966)

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

 



On 06/03/2011 02:47 PM, Brian C. Lane wrote:
> Separate the memory check logic from the act of displaying dialogs or
> switching to text mode. This makes it easier to skip it when --nomemcheck
> is passed.
> 
> Add --nomemcheck which continues the install even if there isn't enough
> memory.
> ---
>   anaconda |   59 +++++++++++++++++++++++++++++++++++++++--------------------
>   1 files changed, 39 insertions(+), 20 deletions(-)
> 
> diff --git a/anaconda b/anaconda
> index 21ae8fe..ff6eda1 100755
> --- a/anaconda
> +++ b/anaconda
> @@ -219,6 +219,7 @@ def parseOptions(argv = None):
>       op.add_option("--dogtail", dest="dogtail",   action="store", type="string")
>       op.add_option("--dlabel", action="store_true", default=False)
>       op.add_option("--image", action="append", dest="images", default=[])
> +    op.add_option("--nomemcheck", action="store_true")
> 
>       # Deprecated, unloved, unused
>       op.add_option("-r", "--rootPath", dest="unsupportedMode",
> @@ -311,7 +312,25 @@ def gtk_warning(title, reason):
>       dialog.run()
>       dialog.destroy()
> 
> -def check_memory(anaconda, opts, display_mode=None):
> +def how_much_ram():
> +    """ Return information on how much RAM is available
> +
> +        A tuple consisting of:
> +        (total_ram, (text_ok, text_ram), (gui_ok, gui_ram))
> +
> +        text_ok and gui_ok are True/False
> +        RAM values are in MiB
> +    """
> +    total_ram = int(isys.total_memory() / 1024)
> +    text_ram = int((isys.MIN_RAM) / 1024)
> +    gui_ram = text_ram + int(isys.GUI_INSTALL_EXTRA_RAM / 1024)
> +
> +    return (total_ram,
> +            (text_ram<= total_ram, text_ram),
> +            (gui_ram<= total_ram, gui_ram)
> +            )

I'm not a big fan of passing back bare tuples, honestly. Why not return a dict
with names here, so it's self descriptive?

> +    (total_ram, (text_ok, text_ram), (gui_ok, gui_ram)) = how_much_ram()

Because that's pretty nauseating.

Aside from that, I don't really have a big problem with either patch, though
I'm still not convinced this won't produce more bs bug reports.

-- 
        Peter

All parts should go together without forcing. You must remember that
the parts you are  reassembling were disassembled by you.  Therefore,
if you can't get them together again, there must be a reason. By all
means, do not use a hammer.
		-- IBM maintenance manual, 1925

_______________________________________________
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