mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 17:33:54 +00:00
update timezone.py shell cmds
This commit is contained in:
parent
22335c2f6c
commit
e16da094d1
@ -60,7 +60,7 @@ def get_zone():
|
||||
'consider using timezone.get_zonecode or timezone.zonecompare')
|
||||
elif 'Solaris' in __grains__['os_family']:
|
||||
cmd = 'grep "TZ=" /etc/TIMEZONE'
|
||||
out = __salt__['cmd.run'](cmd).split('=')
|
||||
out = __salt__['cmd.run'](cmd, python_shell=True).split('=')
|
||||
ret = out[1].replace('"', '')
|
||||
return ret
|
||||
|
||||
@ -217,7 +217,8 @@ def get_hwclock():
|
||||
elif 'Debian' in __grains__['os_family']:
|
||||
#Original way to look up hwclock on Debian-based systems
|
||||
cmd = 'grep "UTC=" /etc/default/rcS | grep -vE "^#"'
|
||||
out = __salt__['cmd.run'](cmd, ignore_retcode=True).split('=')
|
||||
out = __salt__['cmd.run'](
|
||||
cmd, ignore_retcode=True, python_shell=True).split('=')
|
||||
if len(out) > 1:
|
||||
if out[1] == 'yes':
|
||||
return 'UTC'
|
||||
@ -229,7 +230,7 @@ def get_hwclock():
|
||||
return __salt__['cmd.run'](cmd)
|
||||
elif 'Gentoo' in __grains__['os_family']:
|
||||
cmd = 'grep "^clock=" /etc/conf.d/hwclock | grep -vE "^#"'
|
||||
out = __salt__['cmd.run'](cmd).split('=')
|
||||
out = __salt__['cmd.run'](cmd, python_shell=True).split('=')
|
||||
return out[1].replace('"', '')
|
||||
elif 'Solaris' in __grains__['os_family']:
|
||||
if os.path.isfile('/etc/rtc_config'):
|
||||
|
Loading…
Reference in New Issue
Block a user