mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 19:31:26 -07:00
timezone: Assuming UTC when no /etc/localtime exists (#27131)
This commit is contained in:
parent
7a8054812c
commit
4fb5221b5f
1 changed files with 2 additions and 1 deletions
|
@ -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))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue