[master/rhel7-branch] If LANG isn't set, set it to default value. (#997397)

Vratislav Podzimek vpodzime at redhat.com
Fri Aug 23 09:07:09 UTC 2013


On Thu, 2013-08-22 at 09:41 -0400, Samantha N. Bueno wrote:
> Resolves: rhbz#997397
> ---
>  pyanaconda/ui/gui/hubs/progress.py | 11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/pyanaconda/ui/gui/hubs/progress.py b/pyanaconda/ui/gui/hubs/progress.py
> index 935c10b..d1da5ee 100644
> --- a/pyanaconda/ui/gui/hubs/progress.py
> +++ b/pyanaconda/ui/gui/hubs/progress.py
> @@ -31,7 +31,7 @@ from pyanaconda.i18n import _
>  from pyanaconda.localization import expand_langs
>  from pyanaconda.product import productName
>  from pyanaconda.flags import flags
> -from pyanaconda.constants import THREAD_INSTALL, THREAD_CONFIGURATION
> +from pyanaconda.constants import THREAD_INSTALL, THREAD_CONFIGURATION, DEFAULT_LANG
>  from pykickstart.constants import KS_WAIT, KS_SHUTDOWN, KS_REBOOT
>  
>  from pyanaconda.ui.gui.hubs import Hub
> @@ -144,7 +144,14 @@ class ProgressHub(Hub):
>  
>          # We first look for rnotes in paths containing the language, then in
>          # directories without the language component.  You know, just in case.
> -        langs = expand_langs(os.environ["LANG"]) + [""]
> +        try:
> +            langs = expand_langs(os.environ["LANG"]) + [""]
> +        except KeyError:
> +            # if for some reason LANG isn't set to anything, set it to
> +            # the default value
> +            os.environ["LANG"] = DEFAULT_LANG
> +            langs = expand_langs(os.environ["LANG"]) + [""]
> +            
>          paths = ["/tmp/updates/pixmaps/rnotes/%s/",
>                   "/tmp/product/pixmaps/rnotes/%s/",
>                   "/usr/share/anaconda/pixmaps/rnotes/%s/"]
I'd suggest NACK, but it's already pushed. I don't think this is a
proper solution. There should never be a situation that this value is
not set when the installer reaches that piece of code. A proper solution
would be to add some code setting that variable from the kickstart's
value somewhere very early. Otherwise there will be DEFAULT_LANG rnotes
no matter what is set in the kickstart.

-- 
Vratislav Podzimek

Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic



More information about the anaconda-patches mailing list