[master][PATCH] Use the DEFAULT_LANG if GeoIP suggestion cannot be used (#1000715)

David Shea dshea at redhat.com
Thu Aug 29 19:21:58 UTC 2013


On 08/29/2013 08:26 AM, Vratislav Podzimek wrote:
> We don't have all locales listed, so we have to fall back to the default, if
> GeoIP suggests us to use on we don't have.
>
> Signed-off-by: Vratislav Podzimek <vpodzime at redhat.com>
> ---
>   pyanaconda/ui/gui/spokes/welcome.py | 7 +++++++
>   1 file changed, 7 insertions(+)
>
> diff --git a/pyanaconda/ui/gui/spokes/welcome.py b/pyanaconda/ui/gui/spokes/welcome.py
> index b2fc293..30fb525 100644
> --- a/pyanaconda/ui/gui/spokes/welcome.py
> +++ b/pyanaconda/ui/gui/spokes/welcome.py
> @@ -34,6 +34,7 @@ from pyanaconda import flags
>   from pyanaconda import geoloc
>   from pyanaconda.i18n import _
>   from pyanaconda.iutil import is_unsupported_hw, strip_accents
> +from pyanaconda.constants import DEFAULT_LANG
>   
>   import logging
>   log = logging.getLogger("anaconda")
> @@ -172,6 +173,12 @@ class WelcomeLanguageSpoke(StandaloneSpoke):
>           if not itr:
>               itr = self._selectLanguage(self.data.lang.lang)
>   
> +        if not itr:
> +            log.error("Failed to select requested language %s, using the default %s",
> +                      self.data.lang.lang, DEFAULT_LANG)
> +            itr = self._selectLanguage(DEFAULT_LANG)
> +            self.data.lang.lang = DEFAULT_LANG
> +
>           # store is the filtered store, and itr is an iter on it.  We need to
>           # convert to an iter on the underlying store.
>           itr = store.convert_iter_to_child_iter(itr)
Ack.


More information about the anaconda-patches mailing list