Merge pull request #31101 from cachedout/lint_31060

Lint 31060
This commit is contained in:
Mike Place 2016-02-10 12:06:40 -07:00
commit e2a081b662

View File

@ -85,3 +85,34 @@ def _check_minions_directories_raetkey(pki_dir):
rejected = os.path.join(pki_dir, salt.key.RaetKey.REJ)
return accepted, pre, rejected
def kill():
'''
Kill the salt minion.
If you have a monitor that restarts ``salt-minion`` when it dies then this is
a great way to restart after a minion upgrade.
CLI example::
>$ salt minion[12] minion.kill
minion1:
----------
killed:
7874
minion2:
----------
killed:
29071
The result of the salt command shows the process ID of the minions that were
successfully killed - in this case they were ``7874`` and ``29071``.
'''
pid = __grains__.get('pid')
if pid:
if 'ps.kill_pid' in __salt__:
__salt__['ps.kill_pid'](pid)
else:
pid = None
return {'killed': pid}