Merge pull request #16506 from eguven/fix-get-timezone-bug

strip data read from /etc/timezone
This commit is contained in:
Joseph Hall 2014-10-09 07:06:19 -06:00
commit 10fc9d82b8

View File

@ -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']: