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

Fixes #662 accept numbers into configuration file #818

Merged
merged 1 commit into from Jun 13, 2018

Conversation

traylenator
Copy link
Contributor

@traylenator traylenator commented Jun 13, 2018

Pull Request (PR) description

With a configuration of

collectd::python::python{'foo':
  modules => { 'foo' => { config => [{'value' => 4}]
                        }
             }
}

Puppet fails with undefined method scan for 4:Fixnum.

Integers and floats are now accepted and displayed as numbers.

This Pull Request (PR) fixes the following issues

Fixes #662

With a configuration of

```puppet
collectd::python::python{'foo':
  modules => { 'foo' => { config => [{'value' => 4}]
                        }
             }
}
```

Puppet fails with `undefined method scan for 4:Fixnum`.

Integers and floats are now accepted and displayed as numbers.
@@ -7,14 +7,16 @@
<%- configuration.sort.each do |key,value| -%>
<%- if value.is_a?(Array) -%>
<%- value.each do |v| -%>
<%= key %> <% if !!v == v %><%= v %><% else %>"<%= Shellwords.split(v).join('" "') %>"<% end %>
<%= key %> <% if !!v == v %><%= v %><% elsif v.is_a?(Numeric) %><%= v.to_s %><% else %>"<%= Shellwords.split(v).join('" "') %>"<% end %>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it probably makes sense to convert this to epp

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #819

@bastelfreak bastelfreak added the bug Something isn't working label Jun 13, 2018
@bastelfreak bastelfreak merged commit 3abffed into voxpupuli:master Jun 13, 2018
@traylenator traylenator deleted the int branch June 14, 2018 05:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

collectd::plugin::python::module does not support number options
2 participants