(maint) Make Puppet have hard dependency on Facter 2.0#787
(maint) Make Puppet have hard dependency on Facter 2.0#787jeffweiss wants to merge 2 commits intopuppetlabs:masterfrom
Conversation
lib/puppet.rb
Outdated
There was a problem hiding this comment.
Not a big fan of having an "exit" in the middle of a module definition...
There was a problem hiding this comment.
I don't blame you, this is within the Puppet module where we explicitly do want to halt execution because we have a hard dependency on Facter 2.0 which has not been met.
There was a problem hiding this comment.
Yeah but the module isn't driving execution... so it shouldn't be calling "exit". It should raise an exception and let whatever executable is driving the execution of the program decide whether to exit or not.
There was a problem hiding this comment.
Ah, yes. I pulled as-is from @kbarber 's structured facts branch. We can improve on how that's done.
Puppet 3.0 requires Facter 2.0. Make the dependency hard and have Puppet fail with a useful error message if Facter doesn't exist or is the wrong version.
There was a problem hiding this comment.
To do this "right" we should also remove the require 'facter' from the top, but this cascades NameErrors to a bunch of other places.
Rather than hard exiting from anything that happens to include Puppet with an incorrect version of Facter, we'll instead raise a Puppet::Error.
There was a problem hiding this comment.
This version seems much better to me. If we want to be really specific about error handling / messaging, we can catch this in either CommandLine.rb or bin/puppet.rb--those guys are responsible for execution. If this error class is too general to catch in those, we could make a more specific error class for it.
Puppet 3.0 requires Facter 2.0. Make the dependency hard and have Puppet
fail with a useful error message if Facter doesn't exist or is the wrong
version.