Project

General

Profile

Bug #1461 ยป preseed_https_support.diff

Adrian Bridgett, 01/20/2012 10:03 AM

View differences:

app/controllers/hosts_controller.rb
# this is required for template generation (such as pxelinux) which is not done via a web request
def forward_request_url
@host.request_url = request.host_with_port if @host.respond_to?(:request_url)
if @host.respond_to?(:request_url)
@host.request_url = request.host_with_port
@host.protocol = request.protocol.sub(/:.*/,'')
end
end
end
app/models/host_template_helpers.rb
#returns the URL for Foreman based on the required action
def foreman_url(action = "provision")
url_for :only_path => false, :controller => "unattended", :action => action, :host => request_url
url_for :only_path => false, :controller => "unattended", :action => action, :host => request_url, :protocol => protocol
end
end
app/models/orchestration/tftp.rb
def self.included(base)
base.send :include, InstanceMethods
base.class_eval do
attr_accessor :request_url
attr_accessor :request_url, :protocol
after_validation :validate_tftp, :queue_tftp
before_destroy :queue_tftp_destroy
    (1-1/1)