Sha256: b4fab5ee57b8edc839907f5ff31615e3ab6981bac6d547d8977591fceebbbf27

Contents?: true

Size: 721 Bytes

Versions: 6

Compression:

Stored size: 721 Bytes

Contents

class OpenscapProxiesController < ApplicationController
  before_action :find_proxy, :only => [:openscap_spool]

  def openscap_spool
    last_error = @smart_proxy ? find_spool_error : nil
    render :partial => 'smart_proxies/openscap_spool', :locals => { :last_error => last_error }
  end

  private

  def action_permission
    case params[:action]
    when 'openscap_spool'
      :view
    else
      super
    end
  end

  def find_proxy
    @smart_proxy = SmartProxy.find params[:id]
  end

  def find_spool_error
    @smart_proxy.statuses[:logs].
      logs.
      log_entries.
      reverse.
      find { |entry| entry["level"] == "ERROR" && entry["message"].start_with?("Failed to parse Arf Report") }
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
foreman_openscap-0.7.1 app/controllers/openscap_proxies_controller.rb
foreman_openscap-0.6.7 app/controllers/openscap_proxies_controller.rb
foreman_openscap-0.7.0 app/controllers/openscap_proxies_controller.rb
foreman_openscap-0.6.6 app/controllers/openscap_proxies_controller.rb
foreman_openscap-0.6.5 app/controllers/openscap_proxies_controller.rb
foreman_openscap-0.6.4 app/controllers/openscap_proxies_controller.rb