Project

General

Profile

« Previous | Next » 

Revision 4584adc3

Added by Justin Sherrill over 7 years ago

Fixes #16546 - update facts on existing hosts

when create_new_host_when_facts_are_uploaded is set to false

(cherry picked from commit 74002ce3a796ab626f4b5e9c5f031d501424fa22)

View differences:

test/unit/host_test.rb
assert_nil host
end
test 'host is updated when uploading facts if setting is false' do
Host.new(:name => 'sinn1636.lan', :certname => 'sinn1636.cert.fail').save(:validate => false)
Setting[:create_new_host_when_facts_are_uploaded] = false
refute Setting[:create_new_host_when_facts_are_uploaded]
raw = parse_json_fixture('/facts_with_certname.json')
host = Host.import_host(raw['name'], 'puppet', raw['certname'])
assert host.import_facts(raw['facts'])
end
test 'host taxonomies are set to a default when uploading facts' do
Setting[:create_new_host_when_facts_are_uploaded] = true
raw = parse_json_fixture('/facts.json')

Also available in: Unified diff