Merge pull request #33718 from rallytime/bp-33700

Back-port #33700 to 2015.8
This commit is contained in:
Mike Place 2016-06-03 09:10:44 -07:00
commit 2c450a7494

View file

@ -400,6 +400,12 @@ def set_hwclock(clock):
elif clock == 'localtime':
__salt__['file.sed']('/etc/default/rcS', '^UTC=.*', 'UTC=no')
elif 'Gentoo' in __grains__['os_family']:
if clock not in ('UTC', 'localtime'):
raise SaltInvocationError(
'Only \'UTC\' and \'localtime\' are allowed'
)
if clock == 'localtime':
clock = 'local'
__salt__['file.sed'](
'/etc/conf.d/hwclock', '^clock=.*', 'clock="{0}"'.format(clock))