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

(GH-1055) Fix hardcoded cache path #1056

Merged
merged 1 commit into from
Aug 31, 2022
Merged

Conversation

chelnak
Copy link

@chelnak chelnak commented Aug 22, 2022

Prior to this PR the cache path used to create the script file resource was hardcoded to /opt/puppetlabs/puppet/cache.

This PR fixes that by using the puppet_vardir fact provided by stdlib so that we will always get the correct path for the OS that is executing the code.

Additionally, if for some reason the puppet_vardir fact is not available we will fall back to tmp.

Fixes #1055

@chelnak chelnak added the bugfix label Aug 22, 2022
@chelnak chelnak self-assigned this Aug 22, 2022
@chelnak chelnak requested a review from a team as a code owner August 22, 2022 10:30
@puppet-community-rangefinder
Copy link

apt::ppa is a type

Breaking changes to this file WILL impact these 68 modules (exact match):
Breaking changes to this file MAY impact these 10 modules (near match):

This module is declared in 234 of 579 indexed public Puppetfiles.


These results were generated with Rangefinder, a tool that helps predict the downstream impact of breaking changes to elements used in Puppet modules. You can run this on the command line to get a full report.

Exact matches are those that we can positively identify via namespace and the declaring modules' metadata. Non-namespaced items, such as Puppet 3.x functions, will always be reported as near matches only.

Prior to this commit the cache path used to create the script file resource
was hardcoded to /opt/puppetlabs/puppet/cache.

This commit fixes that by using the `puppet_vardir` fact provided by stdlib so
that we will always get the correct path for the OS that is executing the code.

Additionally, if for some reason the `puppet_vardir` fact is not available we
will fall back to `tmp`.
@chelnak chelnak force-pushed the gh-1055-hardcoded_cache_path branch from fee500e to 58265f3 Compare August 22, 2022 19:11
@LukasAud LukasAud merged commit 65e0324 into main Aug 31, 2022
@LukasAud LukasAud deleted the gh-1055-hardcoded_cache_path branch August 31, 2022 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

" Harden PPA defined type " new commit hardcodes Puppet path
2 participants