|
|
|
@ -1,7 +1,7 @@
|
|
|
|
#!/usr/bin/python
|
|
|
|
#!/usr/bin/python
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
|
|
|
|
|
|
|
# Copyright: (c) 2017, Thierry Sallé (@tsalle)
|
|
|
|
# Copyright: (c) 2017, Thierry Sallé (@seuf)
|
|
|
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
|
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
|
|
|
|
|
|
|
|
|
|
from __future__ import absolute_import, division, print_function
|
|
|
|
from __future__ import absolute_import, division, print_function
|
|
|
|
@ -178,7 +178,11 @@ def grafana_plugin(module, params):
|
|
|
|
stdout_lines = stdout.split("\n")
|
|
|
|
stdout_lines = stdout.split("\n")
|
|
|
|
for line in stdout_lines:
|
|
|
|
for line in stdout_lines:
|
|
|
|
if line.find(params['name']):
|
|
|
|
if line.find(params['name']):
|
|
|
|
plugin_name, plugin_version = line.split(' @ ')
|
|
|
|
if line.find(' @ ') != -1:
|
|
|
|
|
|
|
|
line = line.rstrip()
|
|
|
|
|
|
|
|
plugin_name, plugin_version = line.split(' @ ')
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
plugin_version = None
|
|
|
|
return {'msg': 'Grafana plugin {} installed : {}'.format(params['name'], cmd),
|
|
|
|
return {'msg': 'Grafana plugin {} installed : {}'.format(params['name'], cmd),
|
|
|
|
'changed': True,
|
|
|
|
'changed': True,
|
|
|
|
'version': plugin_version}
|
|
|
|
'version': plugin_version}
|
|
|
|
|