Merge pull request #25069 from puneetk/patch-1

Add a helper module function called list_enabled
This commit is contained in:
Thomas S Hatch 2015-06-30 14:53:51 -06:00
commit 38903a94a1

View file

@ -93,6 +93,26 @@ def list_(show_all=False, return_yaml=True):
return {'schedule': {}}
def is_enabled(name):
'''
List a Job only if its enabled
.. versionadded:: 2015.5.3
CLI Example:
.. code-block:: bash
salt '*' schedule.is_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):
'''
Purge all the jobs currently scheduled on the minion