Add a helper module function called list_enabled

This commit is contained in:
puneet kandhari 2015-06-30 08:53:25 -05:00
parent a7154e7471
commit 4f1471d7fb

View file

@ -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):
'''