gentoo / puppet-portage

[ORIGIN] Puppet module providing various Gentoo portage features
GNU General Public License v2.0
49 stars 30 forks source link

Update Facter::Util::Resolution to Facter::Core::Execution for Facter… #137

Closed johnzimm closed 9 years ago

johnzimm commented 9 years ago

This was required to get the portage.rb custom fact to run without error on a puppet run using Puppet 4.2 and Facter 3.0.1.

I think it should be compatible with Facter 2.4 but have not tested.

vikraman commented 9 years ago

Thank you for reporting this and the patch.

According to http://www.rubydoc.info/github/puppetlabs/facter/Facter/Util/Resolution exec should still be there, but it's deprecated and we need to use execute instead. I don't know why it fails to find facter/util/resolution. Facter 3.0 was rewritten in C++ so how does it get resolved from ruby?

@adrienthebo can you take a look?

tampakrap commented 9 years ago

there are ruby bindings

binford2k commented 9 years ago

This is the correct fix. Util::Resolution is actually just an alias to Core::Execution now, so you're already using it anyway. This just moves to the correct method.

:+1:

peterhuene commented 9 years ago

Facter 3 doesn't currently add all of the previous 2.x source paths into loaded features, thus requiring parts of Facter is not desired going forward. We've exposed much of the public 2.x Facter API automatically, so this particular require is not necessary (it also wasn't necessary in 2.x).

I can, however, fix this such that the upcoming Facter 3.0.2 adds facter/util/resolution and a few other "old" paths to the loaded features list to prevent breaking facts like this.

vikraman commented 9 years ago

Merged, thanks.