"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "salt/modules/win_service.py" between
salt-2019.2.0.tar.gz and salt-2019.2.1.tar.gz

About: SaltStack is a systems management software for data center automation, cloud orchestration, server provisioning, configuration management and more. Community version.

win_service.py  (salt-2019.2.0):win_service.py  (salt-2019.2.1)
skipping to change at line 17 skipping to change at line 17
# Import Python libs # Import Python libs
from __future__ import absolute_import, unicode_literals, print_function from __future__ import absolute_import, unicode_literals, print_function
import fnmatch import fnmatch
import logging import logging
import re import re
import time import time
# Import Salt libs # Import Salt libs
import salt.utils.platform import salt.utils.platform
import salt.utils.path
from salt.exceptions import CommandExecutionError from salt.exceptions import CommandExecutionError
# Import 3rd party libs # Import 3rd party libs
try: try:
import win32security import win32security
import win32service import win32service
import win32serviceutil import win32serviceutil
import pywintypes import pywintypes
HAS_WIN32_MODS = True HAS_WIN32_MODS = True
except ImportError: except ImportError:
skipping to change at line 569 skipping to change at line 570
Returns: Returns:
bool: ``True`` if successful, otherwise ``False`` bool: ``True`` if successful, otherwise ``False``
CLI Example: CLI Example:
.. code-block:: bash .. code-block:: bash
salt '*' service.create_win_salt_restart_task() salt '*' service.create_win_salt_restart_task()
''' '''
cmd = 'cmd' # Updated to use full name for Nessus agent
cmd = salt.utils.path.which('cmd')
args = '/c ping -n 3 127.0.0.1 && net stop salt-minion && net start ' \ args = '/c ping -n 3 127.0.0.1 && net stop salt-minion && net start ' \
'salt-minion' 'salt-minion'
return __salt__['task.create_task'](name='restart-salt-minion', return __salt__['task.create_task'](name='restart-salt-minion',
user_name='System', user_name='System',
force=True, force=True,
action_type='Execute', action_type='Execute',
cmd=cmd, cmd=cmd,
arguments=args, arguments=args,
trigger_type='Once', trigger_type='Once',
start_date='1975-01-01', start_date='1975-01-01',
 End of changes. 2 change blocks. 
1 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)