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

Compatibility with Puppet 4 and Facter 3 #559

Merged
merged 2 commits into from
Jul 20, 2015

Conversation

Jmeyering
Copy link
Contributor

No description provided.

@mcanevet
Copy link
Contributor

+1

@jonnytdevops
Copy link
Contributor

It would be appreciated if you could give me your puppet --version and facter --version as I can't actually reproduce this issue.

Thanks

@mcanevet
Copy link
Contributor

@jonnytpuppet I have the issue with puppet-agent 1.2.1

@jonnytdevops
Copy link
Contributor

I'm using puppet-agent-1.2.1-1.el7.x86_64 on EL7 and don't see this...

Can you provide a manifest that brings up the error please?

@Jmeyering
Copy link
Contributor Author

Facter Version 3.0.1 (commit 9b1ef723a1494a01e0eccfe93a75fd43316690c2)
Puppet version 4.2.0

@raphink
Copy link
Contributor

raphink commented Jul 16, 2015

Puppet Agent 1.2.1
Puppetserver 2.1.1

@jonnytdevops
Copy link
Contributor

I'm using the same version and not seeing this.

Can you please confirm if this only happens during the first run? Does it happen after you restart your puppet server?

This could be a known bug in Puppet 4.2.0 that is not related to the firewall module.

@jonnytdevops
Copy link
Contributor

I'm closing this as the .fact method was never removed. You could be hitting another Puppet bug.

@peterhuene
Copy link

This will manifest only when running under Puppet Server and not an MRI master. Because Facter 3 is entirely native code, we decided to only implement the minimum set of the Facter API to get it working under a JRuby environment, which is what Puppet Server is. Thus Facter.value is implemented as it is used most frequently and doesn't require a shim "fact" object as an intermediary for retrieving the fact's value.

While Facter.fact can technically be used in provider methods as they won't execute on the master, all instances of Facter.fact in types and (unfortunately) providers should be replaced with Facter.value to be safe.

@jonnytdevops
Copy link
Contributor

Thanks @peterhuene

I'll submit another PR as the unit tests need updated

@raphink
Copy link
Contributor

raphink commented Jul 20, 2015

To be clear, this is what we're seing when using the Firewall module with Puppet 4:

Evaluation Error: Error while evaluating a Function Call, Could not autoload puppet/type/firewall: Could not autoload puppet/provider/firewall/iptables: undefined method `fact' for Facter:Module at /etc/puppetlabs/code/environments/staging4/modules/osbase/manifests/firewall.pp:5:5 on node  foo.example.com

@jonnytdevops
Copy link
Contributor

@jonnytdevops jonnytdevops reopened this Jul 20, 2015
jonnytdevops added a commit that referenced this pull request Jul 20, 2015
Compatibility with Puppet 4 and Facter 3
@jonnytdevops jonnytdevops merged commit 99283a1 into puppetlabs:master Jul 20, 2015
cegeka-jenkins pushed a commit to cegeka/puppet-firewall that referenced this pull request Oct 23, 2017
Compatibility with Puppet 4 and Facter 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants