-
-
Notifications
You must be signed in to change notification settings - Fork 127
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
Strange issues during unit tests with Puppet 5.3.2 #156
Comments
This issue is also present with puppet 4.10.8. |
Backtrace from puppetserver 5.1.3. The comment in Puppet's code makes me think what this module is doing is no longer supported, but I really hope I'm wrong: https://github.com/puppetlabs/puppet/blob/master/lib/puppet/pops/loader/base_loader.rb#L61-L63
|
This change I've been using in production for some time now and seems to resolve this issue but not sure if the right fix: diff --git a/lib/puppet/type/splunk_config.rb b/lib/puppet/type/splunk_config.rb
index a9e8778..e085c1b 100644
--- a/lib/puppet/type/splunk_config.rb
+++ b/lib/puppet/type/splunk_config.rb
@@ -1,7 +1,7 @@
# Require all of our types so the class names are resolvable for purging
-Dir[File.dirname(__FILE__) + '/splunk*.rb'].each do |file|
- require file unless file == __FILE__
-end
+#Dir[File.dirname(__FILE__) + '/splunk*.rb'].each do |file|
+# require file unless file == __FILE__
+#end |
Finally figured out why this happened. If I included the |
Affected Puppet, Ruby, OS and module versions/distributions
How to reproduce (e.g Puppet code you use)
Run unit tests on role class that pulls in custom types from the splunk module.
What are you seeing
This error:
Error while evaluating a Resource Statement, Could not autoload puppet/type/splunk_config: Attempt to redefine entity 'http://puppet.com/2016.1/runtime/type/splunk_authentication'.
Full output:
What behaviour did you expect instead
Unit tests to pass
Any additional information you'd like to impart
The unit tests work when I use ruby-2.0.0 and Puppet 3.8.6 with future parser. It's not until I switch to ruby-2.4.0 and Puppet 5.3.2 that things begin to fail.
I have two roles, one for search servers (web + search node) and one for indexers. The unit tests fail for both with same error. Unit tests for my roles that use the splunk forwarder types also fail in same way.
I have not tried the failing combination on real systems yet.
The text was updated successfully, but these errors were encountered: