Skip to content

(MODULES-4976) Add windows escaping functions #1235

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

Merged
merged 1 commit into from
Apr 21, 2022

Conversation

smortex
Copy link
Collaborator

@smortex smortex commented Apr 20, 2022

The shell_escape function is not usable on windows where batch files and
powershell scripts use different escape rules.

Add two functions to escape strings on windots for batch (batch_escape)
and powershell (powershell_escape).

The shell_escape function is not usable on windows where batch files and
powershell scripts use different escape rules.

Add two functions to escape strings on windots for batch (batch_escape)
and powershell (powershell_escape).
@smortex smortex requested a review from a team as a code owner April 20, 2022 21:24
@puppet-community-rangefinder
Copy link

batch_escape is a function

that may have no external impact to Forge modules.

powershell_escape is a function

that may have no external impact to Forge modules.

This module is declared in 318 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.

@bastelfreak
Copy link
Collaborator

thanks!

@bastelfreak bastelfreak merged commit 74e13c1 into puppetlabs:main Apr 21, 2022
@alexjfisher
Copy link
Collaborator

What's with these functions using the old API?

@smortex smortex deleted the modules-4976 branch April 26, 2022 19:49
@smortex
Copy link
Collaborator Author

smortex commented Apr 26, 2022

@alexjfisher probably nothing, I though it makes more sense to have these functions beside shell_escape().

Is there something preventing from moving all those legacy functions to newer ones?

@alexjfisher
Copy link
Collaborator

Is there something preventing from moving all those legacy functions to newer ones?

TLDR: Pick some functions you care about and go for it!

Other than time, in most cases no. There was #1079 Not too sure what happened. Perhaps it autoclosed when the branch it was targeting got deleted? @binford2k ?? Any thoughts? That PR was also going to namespace all functions which would have been a breaking change. If namespacing functions, maybe providing deprecated non-namespaced shims like I did in https://github.com/puppetlabs/puppetlabs-postgresql/blob/7992559aaa219d0f736a6b661d48d2e721c322a1/lib/puppet/functions/postgresql_password.rb would be worth doing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants