mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
Merge pull request #8256 from cachedout/sys-shutdown
Modify system shutdown command.
This commit is contained in:
commit
e93faae1b6
@ -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