Sha256: 50c0c8493f6b5f31683b996d84871e80f104caa4e76a9bf3415a893ac6b7c212

Contents?: true

Size: 644 Bytes

Versions: 2

Compression:

Stored size: 644 Bytes

Contents

module ForemanBootdisk
  module RendererMethods
    extend ActiveSupport::Concern

    class_methods do
      def format_bootdisk_chain_url(url, mac)
        u = URI.parse(url)
        ForemanBootdisk.logger.warn("Foreman or proxy is configured with HTTPS, probably not supported by iPXE: #{u}") if u.scheme == 'https'
        u.query = "#{u.query}&mac=#{mac}"
        u.fragment = nil
        u.to_s
      end
    end

    def bootdisk_chain_url(mac = '', action = 'iPXE')
      self.class.format_bootdisk_chain_url(foreman_url(action), mac)
    end

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
foreman_bootdisk-11.0.0 app/services/foreman_bootdisk/renderer_methods.rb
foreman_bootdisk-10.0.2 app/services/foreman_bootdisk/renderer_methods.rb