Skip to content

Commit

Permalink
Adding check_plugin to jenkins module
Browse files Browse the repository at this point in the history
  • Loading branch information
adamjkeller committed Mar 7, 2016
1 parent bf4b651 commit 17612c9
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions salt/modules/jenkins.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,3 +426,31 @@ def get_job_config(name=None):

job_info = server.get_job_config(name)
return job_info


def plugin_installed(name):
'''
.. versionadded:: Carbon
Return if the plugin is installed for the provided plugin name.
:param name: The name of the parameter to confirm installation.
:return: True if plugin exists, False if plugin does not exist.
CLI Example:
.. code-block:: bash
salt '*' jenkins.plugin_installed pluginName
'''

server = _connect()
plugins = server.get_plugins()

exists = [plugin for plugin in plugins.keys() if name in plugin]

if exists:
return True
else:
return False

0 comments on commit 17612c9

Please sign in to comment.