Modify system shutdown command.

New flag to shutdown at a given time. Refs #7833.
This commit is contained in:
Mike Place 2013-11-01 15:00:21 -06:00
parent 5abe667471
commit 7ae51795a1

View File

@ -75,7 +75,7 @@ def reboot():
return ret
def shutdown():
def shutdown(at_time=None):
'''
Shutdown a running system
@ -85,6 +85,10 @@ def shutdown():
salt '*' system.shutdown
'''
cmd = 'shutdown'
if at_time:
cmd = 'shutdown -h {0}'.format(at_time)
else:
cmd = 'shutdown -h now'
ret = __salt__['cmd.run'](cmd)
return ret