[PATCH 20/22] Assume UTC if setting the system time without a timezone
David Shea
dshea at redhat.com
Wed Jun 3 16:03:44 UTC 2015
(cherry picked from commit 27122d4b06afd47988374d0d96a067c4b1cd763e)
Related: rhbz#1188287
---
pyanaconda/isys/__init__.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/pyanaconda/isys/__init__.py b/pyanaconda/isys/__init__.py
index 5cb0a72..9153704 100644
--- a/pyanaconda/isys/__init__.py
+++ b/pyanaconda/isys/__init__.py
@@ -131,6 +131,10 @@ def set_system_date_time(year=None, month=None, day=None, hour=None, minute=None
"""
+ # If no timezone is set, use UTC
+ if not tz:
+ tz = pytz.UTC
+
# get the right values
now = datetime.datetime.now(tz)
year = year if year is not None else now.year
--
2.1.0
More information about the anaconda-patches
mailing list