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

(MODULES-10539) Remove commands idiom from PowerShell provider #287

Merged
merged 1 commit into from
Feb 26, 2020
Merged

(MODULES-10539) Remove commands idiom from PowerShell provider #287

merged 1 commit into from
Feb 26, 2020

Conversation

michaeltlombardi
Copy link
Contributor

Prior to this commit the PowerShell exec provider used the commands idiom to
load the PowerShell executable path for use. Once the module was refactored
to rely on the ruby-pwsh gem via the puppetlabs/pwshlib module, the code for
determining the path was updated to depend on a helper function. However,
the commands method is (apparently?) evaluated during catalogue compilation,
causing the Puppet run to explode unexpectedly if the dependent module is
not available.

This commit removes the commands idiom and relies on the feature confine which
should evaluate during a Puppet run and, when that feature is not found
(because puppetlabs/pwshlib is not installed) it will report that the provider
is not functional rather than blow up the entire Puppet run.

@michaeltlombardi
Copy link
Contributor Author

This PR is in draft format until the litmus acceptance test rewrites are completed and merged so the changes can be verified in acceptance and additional tests provided if necessary.

@michaeltlombardi michaeltlombardi mentioned this pull request Feb 13, 2020
@codecov-io
Copy link

codecov-io commented Feb 13, 2020

Codecov Report

Merging #287 into master will not change coverage.
The diff coverage is 0%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #287   +/-   ##
=====================================
  Coverage       0%     0%           
=====================================
  Files           2      2           
  Lines         183    174    -9     
=====================================
+ Misses        183    174    -9
Impacted Files Coverage Δ
lib/puppet/provider/exec/powershell.rb 0% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 147b85f...3ceb76b. Read the comment docs.

@michaeltlombardi michaeltlombardi marked this pull request as ready for review February 20, 2020 18:31
@michaeltlombardi michaeltlombardi requested a review from a team as a code owner February 20, 2020 18:31
Prior to this commit the PowerShell exec provider used the commands idiom to
load the PowerShell executable path for use. Once the module was refactored
to rely on the ruby-pwsh gem via the puppetlabs/pwshlib module, the code for
determining the path was updated to depend on a helper function. However,
the commands method is (apparently?) evaluated during catalogue compilation,
causing the Puppet run to explode unexpectedly if the dependent module is
not available.

This commit removes the commands idiom and relies on the feature confine which
should evaluate during a Puppet run and, when that feature is not found
(because puppetlabs/pwshlib is not installed) it will report that the provider
is not functional rather than blow up the entire Puppet run.
@sanfrancrisko sanfrancrisko merged commit 83f5d82 into puppetlabs:master Feb 26, 2020
@michaeltlombardi michaeltlombardi deleted the ticket/master/MODULES-10539-remove-command-functionality branch February 26, 2020 17:42
ghomem added a commit to ghomem/puppetlabs-docker-compat that referenced this pull request Mar 10, 2024
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.

4 participants