Adding check_plugin to jenkins module

This commit is contained in:
Adam Keller 2016-03-02 21:38:32 -08:00
parent bf4b651319
commit 17612c9366

View File

@ -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