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

Load install paths from RunMode #9490

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

ekohl
Copy link
Contributor

@ekohl ekohl commented Sep 27, 2024

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, because Puppet::Util::RunMode relies on Puppet::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.

Facter is no longer needed in this script and the actual prerequisite
checking was unmaintained anyway.
This has the benefit that the help texts reflect the actual defaults.
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.
@ekohl ekohl requested a review from a team as a code owner September 27, 2024 15:18
@puppetlabs-jenkins
Copy link
Collaborator

Can one of the admins verify this patch?

1 similar comment
@puppetlabs-jenkins
Copy link
Collaborator

Can one of the admins verify this patch?

@ekohl ekohl mentioned this pull request Sep 27, 2024
@ekohl
Copy link
Contributor Author

ekohl commented Sep 28, 2024

@joshcooper I'd appreciate your thoughts on the direction of this. I'd prefer to avoid loading application code (which can depend on other parts, like I already needed to hack the root feature check) but I'm not sure I see another way.

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.

2 participants