/etc/default/rcS file does not contain UTC boolean value on Debian Wheezy, causes out-of-bounds exception when attempting to lookup given value

This commit is contained in:
Edin Sarajlic 2013-05-11 18:30:30 +10:00
parent 608d24e308
commit bdc83fd758

View File

@ -160,7 +160,7 @@ def get_hwclock():
elif 'Debian' in __grains__['os_family']:
cmd = 'grep "UTC=" /etc/default/rcS | grep -vE "^#"'
out = __salt__['cmd.run'](cmd).split('=')
if out[1] == 'yes':
if len(out) > 1 and out[1] == 'yes':
return 'UTC'
else:
return 'localtime'