Commit c92ee61
committed
(MODULES-10539) Remove commands idiom from PowerShell provider
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.1 parent 63d7409 commit c92ee61
File tree
6 files changed
+78
-13
lines changed- lib/puppet/provider/exec
- spec
- acceptance
- unit/provider/exec
6 files changed
+78
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | 7 | | |
18 | 8 | | |
19 | 9 | | |
| |||
57 | 47 | | |
58 | 48 | | |
59 | 49 | | |
60 | | - | |
| 50 | + | |
61 | 51 | | |
62 | 52 | | |
63 | 53 | | |
| |||
72 | 62 | | |
73 | 63 | | |
74 | 64 | | |
75 | | - | |
| 65 | + | |
76 | 66 | | |
77 | 67 | | |
78 | 68 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
465 | 465 | | |
466 | 466 | | |
467 | 467 | | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
468 | 495 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
517 | 517 | | |
518 | 518 | | |
519 | 519 | | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
520 | 547 | | |
521 | 548 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
58 | 77 | | |
59 | 78 | | |
60 | 79 | | |
61 | 80 | | |
62 | 81 | | |
63 | 82 | | |
64 | | - | |
| 83 | + | |
65 | 84 | | |
66 | 85 | | |
67 | 86 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
0 commit comments