mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Win_service.py to use the new task module
Necessary to fix issue with date locale related issues
This commit is contained in:
parent
2212b52620
commit
082277a727
1 changed files with 9 additions and 5 deletions
|
@ -228,9 +228,14 @@ def create_win_salt_restart_task():
|
|||
|
||||
salt '*' service.create_win_salt_restart_task()
|
||||
'''
|
||||
cmd = 'schtasks /RU "System" /Create /TN restart-salt-minion /TR "cmd /C ping -n 3 127.0.0.1>nul && net stop salt-minion && net start salt-minion" /sc ONCE /sd 01/01/1975 /st 01:00 /F /V1 /Z'
|
||||
|
||||
return __salt__['cmd.shell'](cmd)
|
||||
cmd = 'cmd /c ping -n 3 127.0.0.1 && net stop salt-minion && net start salt-minion'
|
||||
return __salt__['task.create_task'](name='restart-salt-minion',
|
||||
user_name='System',
|
||||
action_type='Execute',
|
||||
cmd=cmd,
|
||||
trigger_type='Once',
|
||||
start_date='1975-01-01',
|
||||
start_time='01:00')
|
||||
|
||||
|
||||
def execute_salt_restart_task():
|
||||
|
@ -243,8 +248,7 @@ def execute_salt_restart_task():
|
|||
|
||||
salt '*' service.execute_salt_restart_task()
|
||||
'''
|
||||
cmd = 'schtasks /Run /TN restart-salt-minion'
|
||||
return __salt__['cmd.shell'](cmd)
|
||||
return __salt__['task.run'](name='restart-salt-minion')
|
||||
|
||||
|
||||
def status(name, sig=None):
|
||||
|
|
Loading…
Add table
Reference in a new issue