Sha256: f76a7aeb5cb62e22e54e58f26801bedc0b78a6cf2931774a3e9ff07f7c970cfe

Contents?: true

Size: 1.36 KB

Versions: 9

Compression:

Stored size: 1.36 KB

Contents

#!/usr/bin/env ruby
#
# Copyright (c) 2014--2015 Red Hat Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 3 (GPLv3). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv3
# along with this software; if not, see http://www.gnu.org/licenses/gpl.txt
#

$LOAD_PATH.unshift '/usr/share/foreman-proxy/lib'
$LOAD_PATH.unshift '/usr/share/foreman-proxy/modules'

require 'smart_proxy'
require 'smart_proxy_main'
require 'smart_proxy_openscap'
require 'smart_proxy_openscap/openscap_lib'

# Don't run if OpenSCAP plugin is disabled.
exit unless Proxy::OpenSCAP::Plugin.settings.enabled == true

# TODO: include some jitter to not bring Foreman to its knees

module Proxy
  module Log
    @@logger = ::Logger.new(Proxy::OpenSCAP.fullpath(Proxy::OpenSCAP::Plugin.settings.openscap_send_log_file), 6, 1024*1024*10)
    @@logger.level = ::Logger.const_get(Proxy::SETTINGS.log_level.upcase)
  end
end
include Proxy::Log

if !Proxy::SETTINGS.foreman_url
  logger.error "Foreman URL not configured"
  exit false
end

begin
  Proxy::OpenSCAP::send_spool_to_foreman
rescue StandardError => e
  logger.error e
  puts "#{e} See #{Proxy::OpenSCAP.fullpath(Proxy::OpenSCAP::Plugin.settings.openscap_send_log_file)}"
  exit false
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
smart_proxy_openscap-0.6.9 bin/smart-proxy-openscap-send
smart_proxy_openscap-0.6.8 bin/smart-proxy-openscap-send
smart_proxy_openscap-0.6.7 bin/smart-proxy-openscap-send
smart_proxy_openscap-0.6.6 bin/smart-proxy-openscap-send
smart_proxy_openscap-0.6.5 bin/smart-proxy-openscap-send
smart_proxy_openscap-0.6.4 bin/smart-proxy-openscap-send
smart_proxy_openscap-0.6.3 bin/smart-proxy-openscap-send
smart_proxy_openscap-0.6.2 bin/smart-proxy-openscap-send
smart_proxy_openscap-0.6.1 bin/smart-proxy-openscap-send