mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
Modify system shutdown command.
New flag to shutdown at a given time. Refs #7833.
This commit is contained in:
parent
5abe667471
commit
7ae51795a1
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user