Project

General

Profile

Feature #323 » 0001-Delay-purging-facts-and-reports-on-host-build.patch

Frank Sweetser, 06/18/2010 08:45 PM

View differences:

app/controllers/unattended_controller.rb
helper :all
before_filter :get_host_details, :allowed_to_install?
before_filter :handle_ca, :except => [:jumpstart_finish, :preseed_finish]
before_filter :clear_host_records
skip_before_filter :require_ssl, :require_login
def kickstart
......
render :template => "unattended/#{type}.local" if File.exists?("#{RAILS_ROOT}/app/views/unattended/#{type}.local.rhtml")
end
def clear_host_records
@host.clearFacts
@host.clearReports
end
end
app/models/host.rb
# Called by build link in the list
# Build is set
# The boot link and autosign entry are created
# Any existing puppet certificates are deleted
# Any facts are discarded
def setBuild
clearFacts
clearReports
#TODO move this stuff to be in the observer, as if the host changes after its being built this might invalidate the current settings
return false unless GW::Tftp.create([mac, os.to_s.gsub(" ","-"), arch.name, serial])
self.build = true
(2-2/2)