Repository navigation
Commit 3b0ddc5
committed
Stop the phpversion fact raising without php
Facter::Core::Execution.execute raises ExecutionFailure when the command
cannot be run, whereas the Facter::Util::Resolution.exec it replaced in
f351625 returned nil. Since that commit every node without php logs
Error: Facter: Error while resolving custom fact fact='phpversion',
resolution='<anonymous>': Could not execute 'php -v': command not found
on every run - the same class of noise the nil guard in 6c1e69e (issue
134) was added to prevent. Passing on_fail: nil restores the old
semantics, and is what the deprecated Facter::Core::Execution.exec did
internally.
The fact resolves to nil either way, since Facter catches and logs the
exception, so the added spec asserts that nothing is logged.
Assisted-By: Claude Opus 5 <noreply@anthropic.com>
Reviewed-by: Tobias Brox <tobias@redpill-linpro.com>1 parent 1a5c207 commit 3b0ddc5
2 files changed
Lines changed: 44 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
0 commit comments