blob: c13cb8baf6030506064e51ced115a432a1028a0e [file] [log] [blame]
chnyda124ca042017-08-03 16:40:51 +02001#!/usr/bin/env python
2
3import jenkins
4import salt.config
5
6def main():
7 output = { "jenkins_plugins" : {} }
8 opts = salt.config.minion_config('/etc/salt/minion')
9 user = opts['jenkins']['user']
10 password = opts['jenkins']['password']
11 url = opts['jenkins']['url']
12
13 server = jenkins.Jenkins(url, username=user, password=password)
14 plugins = server.get_plugins(depth=1)
15 for plugin_name, plugin_dict in plugins.iteritems():
16 output["jenkins_plugins"][plugin_name[0]] = {"version" : (plugin_dict["backupVersion"] or 0)}
17 return output