-
-
Notifications
You must be signed in to change notification settings - Fork 36
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
Could not evaluate: undefined method `[]' for nil:NilClass #134
Comments
@bastelfreak @jsosic @vfoucault @treydock @alexjfisher @pseiler - It looks like you have all touched the |
Aww.
|
Still, it seems like the provider should fail with a more useful error message? |
Could not evaluate: undefined method
[]' for nil:NilClass`Could not evaluate: undefined method \
[]' for nil:NilClass`
Could not evaluate: undefined method \
[]' for nil:NilClass`
That error message is a common problem and yeah makes it tough to debug. I remember it from puppetlabs/puppetlabs-docker#749 too. |
I think this is because of all files in lib/puppet/provider/*/{chkconfig,dpkg}.rb. Debian started a more modern implementation of (update-)alternatives. But chkconfig also provided an implementation. |
I was able to get it working on EL9 with the chkconfig provider. The root cause of the breakage was that EL9 doesn't have a python alternative entry by default. This snippet got it to work: if versioncmp($facts['os']['release']['major'],'8') >= 0 {
package { 'python3': }
-> alternatives { 'python':
path => '/usr/bin/python3',
}
}
if versioncmp($facts['os']['release']['major'],'9') >= 0 {
alternative_entry {'/usr/bin/python3':
ensure => present,
altlink => '/usr/bin/python',
altname => 'python',
priority => 30,
}
-> Alternatives['python']
} However, I believe this is still a valid bug as the provider shouldn't be throwing a stack trace for what is probably a common mis-configuration. |
Constraining the I suppose we could try to do it by version strings
EL9:
However, the EL9 |
Affected Puppet, Ruby, OS and module versions/distributions
How to reproduce (e.g Puppet code you use)
What are you seeing
The above code snippet works fine on EL8 under beaker but is producing an error on EL9.
The text was updated successfully, but these errors were encountered: