mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 14:22:46 +00:00
timezone: Assuming UTC when no /etc/localtime exists (#27131)
This commit is contained in:
committed by
René Moser
parent
7a8054812c
commit
4fb5221b5f
@@ -521,7 +521,8 @@ class BSDTimezone(Timezone):
|
|||||||
tz = os.readlink('/etc/localtime')
|
tz = os.readlink('/etc/localtime')
|
||||||
return tz.replace('/usr/share/zoneinfo/', '')
|
return tz.replace('/usr/share/zoneinfo/', '')
|
||||||
except:
|
except:
|
||||||
self.module.fail_json(msg='Could not read /etc/localtime')
|
self.module.warn('Could not read /etc/localtime. Assuming UTC')
|
||||||
|
return 'UTC'
|
||||||
else:
|
else:
|
||||||
self.module.fail_json(msg='{0} is not a supported option on target platform'.
|
self.module.fail_json(msg='{0} is not a supported option on target platform'.
|
||||||
format(key))
|
format(key))
|
||||||
|
|||||||
Reference in New Issue
Block a user