mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
Adding check_plugin to jenkins module
This commit is contained in:
parent
bf4b651319
commit
17612c9366
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user