Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python plugin template does not create valid module configuration #964

Closed
Slabimic opened this issue Dec 17, 2020 · 0 comments · Fixed by #965
Closed

Python plugin template does not create valid module configuration #964

Slabimic opened this issue Dec 17, 2020 · 0 comments · Fixed by #965

Comments

@Slabimic
Copy link
Contributor

Slabimic commented Dec 17, 2020

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 6.18
  • Ruby: 2.6.2-118
  • Distribution: Centos 7.9
  • Module version: 12.2.1-rc0

How to reproduce (e.g Puppet code you use)

Create python plugin module configuration eg.

collectd::plugin::python::module {
  'haproxy':
     config  => [
       { 
         'Verbose'      => $verbose_logging,
         'ProxyMonitor' => $proxy_monitor,
         'ProxyIgnore'  => $proxy_ignore,
         'Socket'       => $socket,
       }
     ],

Using the https://github.com/mleinart/collectd-haproxy as a module for python plugin.

What are you seeing

The generated configuration (more values assigned to the key on a single line separated by space) eg.

ProxyMonitor "frontend" "backend" "server"

is not compatible with collectd register_config function using the Config object where it is written.

The sequence of children keeps one entry for each configuration option.
-- https://collectd.org/documentation/manpages/collectd-python.5.shtml#config

So the array for values of module key cannot be formed like that as it is not propagated to the module by collectd itself.

What behaviour did you expect instead

The single value per module configuration key is expected, so the result is supposed to be like.

ProxyMonitor "frontend"
ProxyMonitor "backend"
ProxyMonitor "server"

Any additional information you'd like to impart

The affected part of the code is https://github.com/voxpupuli/puppet-collectd/blob/master/templates/plugin/python/module.conf_config.epp#L11-L21

Slabimic added a commit to Slabimic/puppet-collectd that referenced this issue Dec 17, 2020
Collectd expects to have a single value per each key when it is not another Config object instance included within the module configuration. So the result from array of params is supposed to be like.

Key "Value1"
Key "Value 2"
Key 22
Key false

Change of module configuration parsing array values to per single value fixes the issue.

Closes voxpupuli#964
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant