Details
-
Bug
-
Status: Resolved
-
Normal
-
Resolution: Fixed
-
PUP 6.23.0
-
None
-
Night's Watch
-
2
-
NW - 2021-10-20, NW - 2021-11-03
-
Needs Assessment
-
Bug Fix
-
-
Needs Assessment
Description
Calling:
puppet lookup --facts dummy keyX
|
Error: Could not parse application options: undefined method `[]' for nil:NilClass |
Fails because the code that verifies the filename expects, that the filename contains a dot:
option('--facts FACT_FILE') do |arg| |
if %w{.yaml .yml .json}.include?(arg.match(/\.[^.]*$/)[0]) |
options[:fact_file] = arg
|
else |
raise _("The --fact file only accepts yaml and json files.\n%{run_help}") % { run_help: RUN_HELP } |
end
|
end
|
Also, verifying based on the filename that the file contains json/yaml data is not correct in my opinion. In my opinion, the following should also be supported:
puppet lookup --facts <(puppet facts find $nodename | jq .values) --node $nodename keyX
|