Update mod_watch() description for all states.

This commit is contained in:
Michael Lustfield 2018-10-08 17:19:13 -05:00 committed by rallytime
parent bf3d0647fc
commit a70358a1cc
No known key found for this signature in database
GPG key ID: E8F1A4B90D0DEA19
9 changed files with 68 additions and 4 deletions

View file

@ -292,6 +292,12 @@ def mod_watch(name, **kwargs):
'''
The at watcher, called to invoke the watch command.
.. note::
This state exists to support special handling of the ``watch``
:ref:`requisite <requisites>`. It should not be called directly.
Parameters for this function should be set by the state being triggered.
name
The name of the atjob

View file

@ -1233,6 +1233,12 @@ def wait_call(name,
def mod_watch(name, **kwargs):
'''
Execute a cmd function based on a watch call
.. note::
This state exists to support special handling of the ``watch``
:ref:`requisite <requisites>`. It should not be called directly.
Parameters for this function should be set by the state being triggered.
'''
if kwargs['sfun'] in ('wait', 'run', 'watch'):
if kwargs.get('stateful'):

View file

@ -2049,6 +2049,15 @@ def absent(name, force=False):
def mod_watch(name, sfun=None, **kwargs):
'''
The docker_container watcher, called to invoke the watch command.
.. note::
This state exists to support special handling of the ``watch``
:ref:`requisite <requisites>`. It should not be called directly.
Parameters for this function should be set by the state being triggered.
'''
if sfun == 'running':
watch_kwargs = copy.deepcopy(kwargs)
if watch_kwargs.get('watch_action', 'force') == 'force':

View file

@ -411,6 +411,15 @@ def absent(name=None, images=None, force=False):
def mod_watch(name, sfun=None, **kwargs):
'''
The docker_image watcher, called to invoke the watch command.
.. note::
This state exists to support special handling of the ``watch``
:ref:`requisite <requisites>`. It should not be called directly.
Parameters for this function should be set by the state being triggered.
'''
if sfun == 'present':
# Force image to be updated
kwargs['force'] = True

View file

@ -253,7 +253,14 @@ def wait_rm(name, recurse=False, profile=None):
def mod_watch(name, **kwargs):
'''
Execute a etcd function based on a watch call requisite.
The etcd watcher, called to invoke the watch command.
When called, execute a etcd function based on a watch call requisite.
.. note::
This state exists to support special handling of the ``watch``
:ref:`requisite <requisites>`. It should not be called directly.
Parameters for this function should be set by the state being triggered.
'''
# Watch to set etcd key

View file

@ -808,6 +808,12 @@ def mod_watch(name, user=None, **kwargs):
'''
The mounted watcher, called to invoke the watch command.
.. note::
This state exists to support special handling of the ``watch``
:ref:`requisite <requisites>`. It should not be called directly.
Parameters for this function should be set by the state being triggered.
name
The name of the mount point

View file

@ -3186,6 +3186,12 @@ def mod_aggregate(low, chunks, running):
def mod_watch(name, **kwargs):
'''
Install/reinstall a package based on a watch requisite
.. note::
This state exists to support special handling of the ``watch``
:ref:`requisite <requisites>`. It should not be called directly.
Parameters for this function should be set by the state being triggered.
'''
sfun = kwargs.pop('sfun', None)
mapfun = {'purged': purged,

View file

@ -361,7 +361,16 @@ def mod_watch(name,
conf_file=None,
bin_env=None,
**kwargs):
# Always restart on watch
'''
The supervisord watcher, called to invoke the watch command.
Always restart on watch
.. note::
This state exists to support special handling of the ``watch``
:ref:`requisite <requisites>`. It should not be called directly.
Parameters for this function should be set by the state being triggered.
'''
return running(
name,
restart=restart,

View file

@ -270,8 +270,14 @@ def wait(name, url='http://localhost:8080/manager', timeout=180):
def mod_watch(name, url='http://localhost:8080/manager', timeout=180):
'''
The tomcat watcher function.
When called it will reload the webapp in question
The tomcat watcher, called to invoke the watch command.
When called, it will reload the webapp in question
.. note::
This state exists to support special handling of the ``watch``
:ref:`requisite <requisites>`. It should not be called directly.
Parameters for this function should be set by the state being triggered.
'''
msg = __salt__['tomcat.reload'](name, url, timeout)