mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Add a helper module function called list_enabled
This commit is contained in:
parent
a7154e7471
commit
4f1471d7fb
1 changed files with 16 additions and 0 deletions
|
@ -92,6 +92,22 @@ def list_(show_all=False, return_yaml=True):
|
|||
else:
|
||||
return {'schedule': {}}
|
||||
|
||||
def list_enabled(name):
|
||||
'''
|
||||
List a Job only if its enabled
|
||||
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' schedule.enabled name=job_name
|
||||
'''
|
||||
|
||||
current_schedule = __salt__['schedule.list'](show_all=False, return_yaml=False)
|
||||
if name in current_schedule:
|
||||
return current_schedule[name]
|
||||
else:
|
||||
return {}
|
||||
|
||||
def purge(**kwargs):
|
||||
'''
|
||||
|
|
Loading…
Add table
Reference in a new issue