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

splunk_config: Only load other splunk types #95

Merged

Conversation

jameslikeslinux
Copy link
Contributor

The splunk_config type needs to load the other splunk* types for
purging. It did this by requiring all of the other ruby files in the
same directory, which, on the client side, includes types from other
modules. This resulted in type redefinition warnings during the agent
run, and even failures in cases where the other types included libraries
that were not present on the system:

Info: Redefining anchor in Puppet::Type
Info: Redefining file_line in Puppet::Type
Info: Redefining firewall in Puppet::Type
Info: Redefining firewallchain in Puppet::Type
Info: Redefining ini_setting in Puppet::Type
Error: Could not autoload puppet/provider/make_server_update/ruby: cannot load such file -- net/http/post/multipart
Error: Could not autoload puppet/type/splunk_config: Could not autoload puppet/provider/make_server_update/ruby

This changes the splunk_config type to only load other type source
files that start with 'splunk'. Even better still would be to only load
an explicit list of types source files rather than using a glob, but
I'll leave that choice to the module maintainer.

Closes #86

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
The `splunk_config` type needs to load the other `splunk*` types for
purging.  It did this by requiring all of the other ruby files in the
same directory, which, on the client side, includes types from other
modules.  This resulted in type redefinition warnings during the agent
run, and even failures in cases where the other types included libraries
that were not present on the system:

```
Info: Redefining anchor in Puppet::Type
Info: Redefining file_line in Puppet::Type
Info: Redefining firewall in Puppet::Type
Info: Redefining firewallchain in Puppet::Type
Info: Redefining ini_setting in Puppet::Type
Error: Could not autoload puppet/provider/make_server_update/ruby: cannot load such file -- net/http/post/multipart
Error: Could not autoload puppet/type/splunk_config: Could not autoload puppet/provider/make_server_update/ruby
```

This changes the `splunk_config` type to only load other type source
files that start with 'splunk'.  Even better still would be to only load
an explicit list of types source files rather than using a glob, but
I'll leave that choice to the module maintainer.
@dhoppe
Copy link
Member

dhoppe commented Mar 5, 2017

@iamjamestl Thank you very much for your contribution.

@dhoppe dhoppe merged commit af29f5d into voxpupuli:master Mar 5, 2017
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 this pull request may close these issues.

None yet

2 participants