mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
Merge pull request #16506 from eguven/fix-get-timezone-bug
strip data read from /etc/timezone
This commit is contained in:
commit
10fc9d82b8
@ -51,10 +51,10 @@ def get_zone():
|
||||
cmd = 'grep ZONE /etc/sysconfig/clock | grep -vE "^#"'
|
||||
elif 'Debian' in __grains__['os_family']:
|
||||
with salt.utils.fopen('/etc/timezone', 'r') as ofh:
|
||||
return ofh.read()
|
||||
return ofh.read().strip()
|
||||
elif 'Gentoo' in __grains__['os_family']:
|
||||
with salt.utils.fopen('/etc/timezone', 'r') as ofh:
|
||||
return ofh.read()
|
||||
return ofh.read().strip()
|
||||
elif __grains__['os_family'] in ('FreeBSD', 'OpenBSD', 'NetBSD'):
|
||||
return os.readlink('/etc/localtime').lstrip('/usr/share/zoneinfo/')
|
||||
elif 'Solaris' in __grains__['os_family']:
|
||||
|
Loading…
Reference in New Issue
Block a user