Add handling for FreeBSD in method zone_compare to avoid exception when /etc/localtime file does is absent. This is valid configuration on FreeBSD and represents UTC.

This commit is contained in:
campbell 2017-11-20 16:50:20 +00:00
parent 717dd8e549
commit e2f11a0d2b

View File

@ -340,6 +340,10 @@ def zone_compare(timezone):
if 'Solaris' in __grains__['os_family'] or 'AIX' in __grains__['os_family']:
return timezone == get_zone()
if 'FreeBSD' in __grains__['os_family']:
if not os.path.isfile(_get_etc_localtime_path()):
return timezone == get_zone()
tzfile = _get_etc_localtime_path()
zonepath = _get_zone_file(timezone)
try: