Sha256: 00ac0de565f7f635c37a060b8bbd9642b30a06dd8f071eca1d147b5d0045562b

Contents?: true

Size: 740 Bytes

Versions: 2

Compression:

Stored size: 740 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

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

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

    def bootdisk_raise(*args)
      self.class.bootdisk_raise(*args)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
foreman_bootdisk-12.0.1 app/services/foreman_bootdisk/renderer_methods.rb
foreman_bootdisk-12.0.0 app/services/foreman_bootdisk/renderer_methods.rb