Module: ForemanOpenscap::OpenscapProxyExtensions

Extended by:
ActiveSupport::Concern
Included in:
ArfReport
Defined in:
app/models/concerns/foreman_openscap/openscap_proxy_extensions.rb

Instance Method Summary collapse

Instance Method Details

#openscap_proxy_apiObject

Raises:

  • (::Foreman::Exception)


5
6
7
8
9
10
# File 'app/models/concerns/foreman_openscap/openscap_proxy_extensions.rb', line 5

def openscap_proxy_api
  return @openscap_api if @openscap_api
  proxy_url = openscap_proxy.url if openscap_proxy
  raise ::Foreman::Exception.new(N_("No OpenSCAP proxy found for %{class} with id %{id}"), { :class => self.class, :id => id }) unless proxy_url
  @openscap_api = ::ProxyAPI::Openscap.new(:url => proxy_url)
end