[rhel7-branch][master][PATCH] Handle kickstarts that don't specify timezone (#1001598)

Vratislav Podzimek vpodzime at redhat.com
Thu Sep 5 14:17:14 UTC 2013


On Thu, 2013-09-05 at 15:10 +0200, Martin Kolman wrote:
> During kickstarted installation, no default timezone is set
> and if the kickstart does not specify a timezone, the date time spoke
> needs to work correctly without an initial timezone value.
> 
> Signed-off-by: Martin Kolman <mkolman at redhat.com>
> ---
>  pyanaconda/ui/gui/spokes/datetime_spoke.py | 13 +++++++++----
>  1 file changed, 9 insertions(+), 4 deletions(-)
> 
> diff --git a/pyanaconda/ui/gui/spokes/datetime_spoke.py b/pyanaconda/ui/gui/spokes/datetime_spoke.py
> index 5e0c9ce..cfd4887 100644
> --- a/pyanaconda/ui/gui/spokes/datetime_spoke.py
> +++ b/pyanaconda/ui/gui/spokes/datetime_spoke.py
> @@ -405,12 +405,16 @@ class DatetimeSpoke(FirstbootSpokeMixIn, NormalSpoke):
>              return _("Nothing selected")
>  
>      def apply(self):
> -        old_tz = self.data.timezone.timezone
> -
>          # we could use self._tzmap.get_timezone() here, but it returns "" if
>          # Etc/XXXXXX timezone is selected
>          region = self._get_active_region()
>          city = self._get_active_city()
> +        # nothing selected, just leave the spoke and
> +        # return to hub without changing anything
> +        if not region or not city:
> +            return
> +
> +        old_tz = self.data.timezone.timezone
>          new_tz = region + "/" + city
>  
>          self.data.timezone.timezone = new_tz
> @@ -702,8 +706,9 @@ class DatetimeSpoke(FirstbootSpokeMixIn, NormalSpoke):
>  
>      def _restore_old_city_region(self):
>          """Restore stored "old" (or last valid) values."""
> -
> -        self._set_timezone(self._old_region + "/" + self._old_city)
> +        # check if there are old value to go back to
> +        if self._old_region and self._old_city:
> +            self._set_timezone(self._old_region + "/" + self._old_city)
>  
>      def on_up_hours_clicked(self, *args):
>          self._stop_and_maybe_start_time_updating()
Looks good to me.

-- 
Vratislav Podzimek

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



More information about the anaconda-patches mailing list