mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Add watch functions to module state
This commit is contained in:
parent
db9e081cb3
commit
8bfd096629
1 changed files with 18 additions and 0 deletions
|
@ -14,6 +14,22 @@ data with the argument m_name.
|
|||
import salt.state
|
||||
|
||||
|
||||
def wait(name, **kwargs):
|
||||
'''
|
||||
Run a single module function only if the watch statement calls it
|
||||
|
||||
name
|
||||
The module function to execute
|
||||
|
||||
**kwargs
|
||||
Pass any arguments needed to execute the function
|
||||
'''
|
||||
return {'name': name,
|
||||
'changes': {},
|
||||
'result': True,
|
||||
'comment': ''}
|
||||
|
||||
|
||||
def run(name, **kwargs):
|
||||
'''
|
||||
Run a single module function
|
||||
|
@ -102,3 +118,5 @@ def run(name, **kwargs):
|
|||
ret['result'] = True
|
||||
ret['changes']['ret'] = mret
|
||||
return ret
|
||||
|
||||
mod_watch = run
|
||||
|
|
Loading…
Add table
Reference in a new issue