mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
Merge pull request #36381 from twangboy/fix_win_service
Add '/y' switch to the net stop and start commands
This commit is contained in:
commit
2aa6df859a
@ -165,7 +165,7 @@ def start(name):
|
||||
|
||||
salt '*' service.start <service name>
|
||||
'''
|
||||
cmd = ['net', 'start', name]
|
||||
cmd = ['net', 'start', '/y', name]
|
||||
return not __salt__['cmd.retcode'](cmd, python_shell=False)
|
||||
|
||||
|
||||
@ -183,7 +183,7 @@ def stop(name):
|
||||
# up if the service takes too long to stop with a misleading
|
||||
# "service could not be stopped" message and RC 0.
|
||||
|
||||
cmd = ['net', 'stop', name]
|
||||
cmd = ['net', 'stop', '/y', name]
|
||||
res = __salt__['cmd.run'](cmd, python_shell=False)
|
||||
if 'service was stopped' in res:
|
||||
return True
|
||||
|
Loading…
Reference in New Issue
Block a user