mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #25069 from puneetk/patch-1
Add a helper module function called list_enabled
This commit is contained in:
commit
38903a94a1
1 changed files with 20 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue