Project

General

Profile

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
3 3
  helper :all
4 4
  before_filter :get_host_details, :allowed_to_install?
5 5
  before_filter :handle_ca, :except => [:jumpstart_finish, :preseed_finish]
6
  before_filter :clear_host_records
6 7
  skip_before_filter :require_ssl, :require_login
7 8

  
8 9
  def kickstart
......
97 98
    render :template => "unattended/#{type}.local" if File.exists?("#{RAILS_ROOT}/app/views/unattended/#{type}.local.rhtml")
98 99
  end
99 100

  
101
  def clear_host_records
102
    @host.clearFacts
103
    @host.clearReports
104
  end
105

  
100 106
end
app/models/host.rb
291 291
  # Called by build link in the list
292 292
  # Build is set
293 293
  # The boot link and autosign entry are created
294
  # Any existing puppet certificates are deleted
295
  # Any facts are discarded
296 294
  def setBuild
297
    clearFacts
298
    clearReports
299 295
    #TODO move this stuff to be in the observer, as if the host changes after its being built this might invalidate the current settings
300 296
    return false unless GW::Tftp.create([mac, os.to_s.gsub(" ","-"), arch.name, serial])
301 297
    self.build = true
302
-