From 57cfef7d138874843b09fe7f45c8f483c67b66c9 Mon Sep 17 00:00:00 2001 From: Calin Crisan Date: Thu, 26 Feb 2015 22:24:58 +0200 Subject: [PATCH] tzctl fixes --- src/tzctl.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/tzctl.py b/src/tzctl.py index ec90764..c534562 100644 --- a/src/tzctl.py +++ b/src/tzctl.py @@ -87,24 +87,19 @@ def _get_time_zone_md5(): def _get_time_zone(): - time_zone = _get_time_zone_symlink() or _get_time_zone_md5() - if not time_zone: - logging.error('could not find local time zone') - - return time_zone + return _get_time_zone_symlink() or _get_time_zone_md5() or 'UTC' def _set_time_zone(time_zone): - if not time_zone: - return logging.warn('ignoring null time zone') + time_zone = time_zone or 'UTC' - zoneinfo_file = '/usr/share/zoneinfo/' + zoneinfo_file = '/usr/share/zoneinfo/' + time_zone if not os.path.exists(zoneinfo_file): logging.error('%s file does not exist' % zoneinfo_file) return False - logging.debug('linking "%s" to "%s"...' % (settings.LOCAL_TIME_FILE, zoneinfo_file)) + logging.debug('linking "%s" to "%s"' % (settings.LOCAL_TIME_FILE, zoneinfo_file)) try: os.remove(settings.LOCAL_TIME_FILE) -- 2.39.5