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

Fixed the salt.modules.npm module to check the npm version correctly on the Windows platform #51813

Merged
merged 3 commits into from
Mar 5, 2019

Conversation

arizvisa
Copy link
Contributor

What does this PR do?

On the Windows platform, the salt.modules.npm module does not check the npm version correctly. This is likely because the npm script that is installed is actually npm.CMD. When checking the version, the salt.modules.npm module attempts to call just npm.

This PR locates npm by using salt.utils.path.which() to detect the path before checking the version. The version check uses salt.modules.cmdmod.run whereas the rest of the module uses salt.modules.cmdmod.run_all. It was not determined why salt.modules.cmdmod.run acts different from salt.modules.cmdmod.run_all when running a cmd-script on the Windows platform.

What issues does this PR fix or reference?

This closes issue #51811.

Previous Behavior

When performing the version check, the module is unable to locate the npm binary (or script, really) and thus the version check fails.

New Behavior

Due to checking for the full path of npm.cmd, the version is correctly detected and the rest of the module works. (npm.install, npm.uninstall, and npm.list was checked).

Tests written?

No

Commits signed with GPG?

No

…ction name that's likely not to change during refactoring...
…or a function name that's likely not to change during refactoring..."

This reverts commit 7c277b7.
arizvisa added a commit to arizvisa/lolfuzz3 that referenced this pull request Feb 25, 2019
…that fixes the version detection in the npm module. Wtf dude...
@dwoz dwoz merged commit 0f0b983 into saltstack:develop Mar 5, 2019
garethgreenaway added a commit to garethgreenaway/salt that referenced this pull request Sep 19, 2019
dwoz added a commit that referenced this pull request Dec 19, 2019
arizvisa added a commit to arizvisa/lolfuzz3 that referenced this pull request May 24, 2020
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.

3 participants