Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This avoids duplicating the defaults that already exist within the run mode. It also opens up the path to more run modes where the paths could be different (#8636).
To do so, it first cleans things up by removing an unused import. Then it starts using
Puppet::Util::Platform
to remove the use of facter. This is ok, becausePuppet::Util::RunMode
relies onPuppet::Util::Platform
. After that, prerequisite checking isn't really needed anymore so it's dropped. It wasn't really maintained anyway.Then comes the first big refactor: setting the options before loading the parser. This has the benefit that it shows the actual defaults in the help text and removes all selection later in the code. The last patch loads the values from RunMode where possible.
There are further clean ups possible (and I have them locally), but this patch is big enough now.
I also took a stab at completely rewriting everything to a Rake task, but that's a lot more complex for now. Another option I had a look at was (ab)using extensions to install the man pages and additional files, but that was even more complex. So for now I opted to at least work within the existing script.