-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
(PUP-11655) Use run_mode for better platform independence #9294
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -87,6 +87,22 @@ def run_dir | |||||
def log_dir | ||||||
which_dir("/var/log/puppetlabs/puppet", "~/.puppetlabs/var/log") | ||||||
end | ||||||
|
||||||
def pkg_config_path | ||||||
'/opt/puppetlabs/puppet/lib/pkgconfig' | ||||||
end | ||||||
|
||||||
def gem_cmd | ||||||
'/opt/puppetlabs/puppet/bin/gem' | ||||||
end | ||||||
|
||||||
def common_module_dir | ||||||
'/opt/puppetlabs/puppet/modules' | ||||||
end | ||||||
|
||||||
def vendor_module_dir | ||||||
'/opt/puppetlabs/puppet/vendor_modules' | ||||||
end | ||||||
end | ||||||
|
||||||
class WindowsRunMode < RunMode | ||||||
|
@@ -114,8 +130,32 @@ def log_dir | |||||
which_dir(File.join(windows_common_base("puppet/var/log")), "~/.puppetlabs/var/log") | ||||||
end | ||||||
|
||||||
def pkg_config_path | ||||||
nil | ||||||
end | ||||||
|
||||||
def gem_cmd | ||||||
if (puppet_dir = ENV.fetch('PUPPET_DIR', nil)) | ||||||
File.join(puppet_dir.to_s, 'bin', 'gem.bat') | ||||||
else | ||||||
File.join(Gem.default_bindir, 'gem.bat') | ||||||
end | ||||||
end | ||||||
|
||||||
def common_module_dir | ||||||
"#{installdir}/puppet/modules" if installdir | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I kept this as it used to be, but I was wondering if this is better
Suggested change
|
||||||
end | ||||||
|
||||||
def vendor_module_dir | ||||||
"#{installdir}\\puppet\\vendor_modules" if installdir | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And the same here:
Suggested change
|
||||||
end | ||||||
|
||||||
private | ||||||
|
||||||
def installdir | ||||||
ENV.fetch('FACTER_env_windows_installdir', nil) | ||||||
end | ||||||
|
||||||
def windows_common_base(*extra) | ||||||
[ENV.fetch('ALLUSERSPROFILE', nil), "PuppetLabs"] + extra | ||||||
end | ||||||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To preserve API compatibility, I kept the
Puppet.default_vendormoduledir
. It also makes testing the default values for settings a bit easier, because of the way settings definitions are loaded once