Module: ForemanBootdisk::TemplateHelpers

Extended by:
ApipieDSL::Class
Defined in:
app/lib/foreman_bootdisk/template_helpers.rb

Instance Method Summary collapse

Instance Method Details

#bootdisk_chain_url(mac = host.try(:mac), action = 'iPXE') ⇒ Object



19
20
21
22
23
24
25
26
27
28
# File 'app/lib/foreman_bootdisk/template_helpers.rb', line 19

def bootdisk_chain_url(mac = host.try(:mac), action = 'iPXE')
  url = foreman_url(action)
  u = URI.parse(url)
  new_query_data = URI.decode_www_form(u.query || '') << ['mac', mac || '']
  new_querystring = URI.encode_www_form(new_query_data)
  u.query = nil
  u.query = new_querystring if new_querystring.present?
  u.fragment = nil
  u.to_s
end

#bootdisk_raise(*args) ⇒ Object

Raises:

  • (::Foreman::Exception)


40
41
42
# File 'app/lib/foreman_bootdisk/template_helpers.rb', line 40

def bootdisk_raise(*args)
  raise ::Foreman::Exception.new(*args)
end

#template_nameObject



44
45
46
# File 'app/lib/foreman_bootdisk/template_helpers.rb', line 44

def template_name
  "Foreman Bootdisk"
end