-
-
Notifications
You must be signed in to change notification settings - Fork 101
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
In Puppet 6, remove_undef_values doesn't work as expected #120
Comments
I guess my (unexpected behaviour is similar, on my agent (linux, RHEL7) I got: Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Function Call, undefined method `length' for nil:NilClass (file: /etc/puppetlabs/code/environments/production/modules/yum/manifests/init.pp, line: 222, column: 20) on node template.test.intern on the "puppet agent -t" command Root cause was on the puppet master (linux, debian 9.5) I upgraded from puppet 5.5 to 6.0 (already installed "puppet module install puppet-yum --version 3.1.0" as of puppet 5.5) In my site.pp I have the offending line/class class { 'yum': manage_os_default_repos => true, } which I now have to comment to let my puppet agent not to fail Please fix, maybe the root cause is as written above |
Take a look at my commit to see my fix to what the underlying problem is. The problem is that puppet's "remove_undef_values" method does not work as expected and even states in the ruby file that it is not the "best practice" way of removing undefined values. |
I think this issue can be closed, since the pull request #121 was merged. |
Affected Puppet, Ruby, OS and module versions/distributions
How to reproduce (e.g Puppet code you use)
What are you seeing
The puppet run fails due to trying to get the "length" member from a Nil object (because remove_undef_values does not remove the undef (Nil) value).
What behaviour did you expect instead
Puppet runs without errors.
Output log
Server Error: Evaluation Error: Error while evaluating a Function Call, undefined method 'length' for nil:NilClass (file: /etc/puppetlabs/code/environments/production/modules/yum/manifests/init.pp, line: 222, column: 20) on node mynode.com.
Any additional information you'd like to impart
I'm submitting a PR to fix this issue by removing undefined values with a filter.
The text was updated successfully, but these errors were encountered: