Details
-
Bug
-
Status: Resolved
-
Normal
-
Resolution: Won't Fix
-
None
-
None
-
None
-
-
Night's Watch
-
1
-
NW - 2021-09-22
-
Needs Assessment
-
Not Needed
-
Needs Assessment
Description
Running facter cli with `--json` produces different outputs, on Facter 3 and Facter 4, for facts that cannot be resolved when querying for fact names
# facter 4
|
❯ bx facter non_existent --json
|
{
|
"non_existent": null
|
}
|
|
# facter 3
|
❯ cfacter non_existent --json
|
{
|
"non_existent": ""
|
}
|
This can also be seen with external executable facts that do not produce any output, or have errors, creating entries in `puppet facts diff`
cat /etc/facter/facts.d/bad.sh
|
#!/bin/sh
|
echo bad=`abc`
|
|
puppet facts diff
|
Warning: Facter: external fact file "/etc/facter/facts.d/bad.sh" had output on stderr: /etc/facter/facts.d/bad.sh: line 2: abc: command not found
|
Warning: Facter: external fact file "/etc/facter/facts.d/bad.sh" had output on stderr: /etc/facter/facts.d/bad.sh: line 2: abc: command not found
|
{
|
"bad": {
|
"new_value": null,
|
"old_value": ""
|
}
|
}
|