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

Avoid Dir.chdir by passing cwd to execute() and simplify %s detection in custom_command #531

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ekohl
Copy link
Member

@ekohl ekohl commented Sep 13, 2024

The use of chdir is problematic in threaded environments (only one thread may chdir) and Puppet has a native method for this. See puppetlabs/puppet#9387 for more information.

It also simplifies the detection of %s in custom_command by using the cheaper include? method. The safe operator makes it even shorter.

This uses the cheaper include? to determine if %s is in custom_command.
It also simplifies the expression with a safe operator.
The use of chdir is problematic in threaded environments (only one
thread may chdir) and Puppet has a native method for this.

Link: puppetlabs/puppet#9387
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