diff options
author | Vratislav Podzimek <vpodzime@redhat.com> | 2012-10-05 19:55:53 +0200 |
---|---|---|
committer | Vratislav Podzimek <vpodzime@redhat.com> | 2012-10-12 15:46:48 +0200 |
commit | d07d85cac64a2a86c01e351c4c6fdf99b204e2da (patch) | |
tree | fb33386b99f7e216be8e61fae05164d24913a575 /pyanaconda/timezone.py | |
parent | ce80cc79661ca7afa6ea1d354a99a29d41229a0b (diff) | |
download | anaconda-d07d85cac64a2a86c01e351c4c6fdf99b204e2da.tar.gz anaconda-d07d85cac64a2a86c01e351c4c6fdf99b204e2da.tar.xz anaconda-d07d85cac64a2a86c01e351c4c6fdf99b204e2da.zip |
Minimum we have to do with HW clock
Diffstat (limited to 'pyanaconda/timezone.py')
-rw-r--r-- | pyanaconda/timezone.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/pyanaconda/timezone.py b/pyanaconda/timezone.py index 0b7173d15..6d07317b4 100644 --- a/pyanaconda/timezone.py +++ b/pyanaconda/timezone.py @@ -29,6 +29,7 @@ import pytz from collections import OrderedDict from pyanaconda import localization +from pyanaconda import iutil import logging log = logging.getLogger("anaconda") @@ -87,6 +88,24 @@ def write_timezone_config(timezone, root): msg = "Error while writing /etc/adjtime file: %s" % ioerr.strerror raise TimezoneConfigError(msg) +def save_hw_clock(timezone): + """ + Save system time to HW clock. + + @param timezone: ksdata.timezone object + + """ + + cmd = "hwclock" + args = ["--systohc"] + if timezone.isUtc: + args.append("--utc") + else: + args.append("--local") + + iutil.execWithRedirect(cmd, args, stdout="/dev/tty5", stderr="/dev/tty5") + + def get_all_territory_timezones(territory): """ Return the list of timezones for a given territory. |