mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
The watcher function is called mod_watch now
and has been for some time...
This commit is contained in:
parent
7b63b7edb5
commit
53285798e0
@ -140,19 +140,19 @@ installed. This is normal require behavior, but if the watched file changes,
|
||||
or the watched package is installed or upgraded, then the redis service is
|
||||
restarted.
|
||||
|
||||
Watch and the Watcher Function
|
||||
------------------------------
|
||||
Watch and the mod_watch Function
|
||||
--------------------------------
|
||||
|
||||
The watch requisite is based on the ``watcher`` function. Python state
|
||||
modules can include a function called ``watcher`` which is then called
|
||||
The watch requisite is based on the ``mod_watch`` function. Python state
|
||||
modules can include a function called ``mod_watch`` which is then called
|
||||
if the watch call is invoked. In the case of the service module the underlying
|
||||
service is restarted. In the case of the cmd state the command is executed.
|
||||
|
||||
The watcher function for the service state looks like this:
|
||||
The ``mod_watch`` function for the service state looks like this:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
def watcher(name, sig=None):
|
||||
def mod_watch(name, sig=None):
|
||||
'''
|
||||
The service watcher, called to invoke the watch command.
|
||||
|
||||
@ -174,10 +174,10 @@ The watcher function for the service state looks like this:
|
||||
'result': True,
|
||||
'comment': 'Service {0} started'.format(name)}
|
||||
|
||||
The watch requisite only works if the state that is watching has a watcher
|
||||
function written. If watch is set on a state that does not have a watcher
|
||||
function (like pkg), then the listed states will behave only as if they were
|
||||
under a ``require`` statement.
|
||||
The watch requisite only works if the state that is watching has a
|
||||
``mod_watch`` function written. If watch is set on a state that does not have
|
||||
a ``mod_watch`` function (like pkg), then the listed states will behave only
|
||||
as if they were under a ``require`` statement.
|
||||
|
||||
The Order Option
|
||||
================
|
||||
|
Loading…
Reference in New Issue
Block a user