mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #23470 from twangboy/fix_svc_restart
Fixed service.restart for salt-minion
This commit is contained in:
commit
aa5b896d3e
2 changed files with 4 additions and 4 deletions
|
@ -252,7 +252,7 @@ def create_win_salt_restart_task():
|
|||
'''
|
||||
cmd = 'schtasks /RU "System" /Create /TN restart-salt-minion /TR "powershell Restart-Service salt-minion" /sc ONCE /sd 01/15/1975 /st 01:00 /F'
|
||||
|
||||
return __salt__['cmd.run'](cmd)
|
||||
return __salt__['cmd.shell'](cmd)
|
||||
|
||||
|
||||
def execute_salt_restart_task():
|
||||
|
@ -266,7 +266,7 @@ def execute_salt_restart_task():
|
|||
salt '*' service.execute_salt_restart_task()
|
||||
'''
|
||||
cmd = 'schtasks /Run /TN restart-salt-minion'
|
||||
return __salt__['cmd.run'](cmd)
|
||||
return __salt__['cmd.shell'](cmd)
|
||||
|
||||
|
||||
def status(name, sig=None):
|
||||
|
|
|
@ -149,7 +149,7 @@ class WinServiceTestCase(TestCase):
|
|||
scheduler to enable restarting the salt-minion
|
||||
'''
|
||||
mock_true = MagicMock(return_value=True)
|
||||
with patch.dict(win_service.__salt__, {'cmd.run': mock_true}):
|
||||
with patch.dict(win_service.__salt__, {'cmd.shell': mock_true}):
|
||||
self.assertTrue(win_service.create_win_salt_restart_task())
|
||||
|
||||
def test_execute_salt_restart_task(self):
|
||||
|
@ -157,7 +157,7 @@ class WinServiceTestCase(TestCase):
|
|||
Test to run the Windows Salt restart task
|
||||
'''
|
||||
mock_true = MagicMock(return_value=True)
|
||||
with patch.dict(win_service.__salt__, {'cmd.run': mock_true}):
|
||||
with patch.dict(win_service.__salt__, {'cmd.shell': mock_true}):
|
||||
self.assertTrue(win_service.execute_salt_restart_task())
|
||||
|
||||
def test_status(self):
|
||||
|
|
Loading…
Add table
Reference in a new issue