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

fix for: undefined method `scan' for nil:NilClass #13

Merged
merged 1 commit into from Aug 9, 2021
Merged

fix for: undefined method `scan' for nil:NilClass #13

merged 1 commit into from Aug 9, 2021

Conversation

fraenki
Copy link
Member

@fraenki fraenki commented Aug 9, 2021

On Puppet 7.9.0 (FreeBSD) I've noticed the following error:

# puppet agent -t --noop --trace
Info: Using configured environment 'development'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Error: Failed to apply catalog: undefined method `scan' for nil:NilClass
/usr/local/lib/ruby/site_ruby/2.7/puppet/util/package.rb:4:in `versioncmp'
/var/puppet/lib/puppet/confine/postfix_version.rb:12:in `pass?'
...

The following patch seems to fix it and still works on Puppet 6.

@oxc
Copy link
Collaborator

oxc commented Aug 9, 2021

Thanks! I would rather have postfix_version return :absent in this case, and not change the pass method.

Could you try something like

postfix_version = postfix_facts[:version]
postfix_version.nil? ? :absent : postfix_version

I'm afraid I won't get around to testing this the next couple of days.

@fraenki
Copy link
Member Author

fraenki commented Aug 9, 2021

@oxc Your suggestion works, so I've updated this PR accordingly.

@oxc oxc merged commit 3299afe into markt-de:master Aug 9, 2021
@oxc
Copy link
Collaborator

oxc commented Aug 9, 2021

Thanks!

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