Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/puppet/application/lookup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
class Puppet::Application::Lookup < Puppet::Application
RUN_HELP = _("Run 'puppet lookup --help' for more details").freeze
DEEP_MERGE_OPTIONS = '--knock-out-prefix, --sort-merged-arrays, and --merge-hash-arrays'
TRUSTED_INFORMATION_FACTS = %w[hostname domain fqdn clientcert].freeze
TRUSTED_INFORMATION_FACTS = %w[hostname domain fqdn].freeze

run_mode :server

Expand Down
14 changes: 13 additions & 1 deletion spec/unit/application/lookup_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ def run_lookup(lookup)

expect {
lookup.run_command
}.to raise_error(/When overriding any of the hostname,domain,fqdn,clientcert facts with #{file_path} given via the --facts flag, they must all be overridden./)
}.to raise_error(/When overriding any of the hostname,domain,fqdn facts with #{file_path} given via the --facts flag, they must all be overridden./)
end

it 'does not fail when all trusted information facts are provided via --facts file' do
Expand All @@ -668,6 +668,18 @@ def run_lookup(lookup)
fqdn: some.fqdn.com
hostname: some.hostname
domain: some.domain
CONTENT
lookup.options[:fact_file] = file_path

expect {
lookup.run_command
}.to exit_with(0)
.and output(/This is in facts hash/).to_stdout
end

it 'does not fail when clientcert is provided without other trusted facts' do
file_path = file_containing('facts.yaml', <<~CONTENT)
---
clientcert: some.clientcert
CONTENT
lookup.options[:fact_file] = file_path
Expand Down