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')
|
||||
return tz.replace('/usr/share/zoneinfo/', '')
|
||||
except:
|
||||
self.module.fail_json(msg='Could not read /etc/localtime')
|
||||
self.module.warn('Could not read /etc/localtime. Assuming UTC')
|
||||
return 'UTC'
|
||||
else:
|
||||
self.module.fail_json(msg='{0} is not a supported option on target platform'.
|
||||
format(key))
|
||||
|
|
Loading…
Reference in a new issue