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:

app/models/host/base.rb
# expect a facts hash
def import_facts(facts)
return false unless create_new_host_when_facts_are_uploaded?
return false if !create_new_host_when_facts_are_uploaded? && new_record?
# we are not importing facts for hosts in build state (e.g. waiting for a re-installation)
raise ::Foreman::Exception.new('Host is pending for Build') if build?

Also available in: Unified diff