Add '/y' switch to the net stop and start commands

This commit is contained in:
twangboy 2016-09-16 15:07:26 -06:00
parent 40b2e3d189
commit 04edea5c59

View file

@ -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