Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1634223 - /usr/bin/smart-proxy-openscap-send script is broken and never run.
Summary: /usr/bin/smart-proxy-openscap-send script is broken and never run.
Keywords:
Status: CLOSED DUPLICATE of bug 1542023
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: SCAP Plugin
Version: 6.3.3
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-09-29 05:10 UTC by Hao Chang Yu
Modified: 2021-12-10 17:43 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-10-02 08:16:59 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Hao Chang Yu 2018-09-29 05:10:05 UTC
Description of problem:

Run "/usr/bin/smart-proxy-openscap-send" manually and it will exit immediately without doing anything.

The log file is empty and last update since Feb.
# ls -lrt /var/log/foreman-proxy/openscap-send.log
-rw-r--r--. 1 foreman-proxy foreman-proxy 0 Feb 16  2017 /var/log/foreman-proxy/openscap-send.log

When debugging the script, I found that the plugin settings are not loaded.

1) Edit "/usr/bin/smart-proxy-openscap-send"

puts "Plugin settings: #{Proxy::OpenSCAP::Plugin.settings.to_h}" <==== add this line

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

2) Run it again

# /usr/bin/smart-proxy-openscap-send
Plugin settings: {}          <=========== Setting is empty

Tested in Satellite 6.2.15 too and it works.

I found that in Satellite 6.2, the module will autoload the settings if not loaded, but in Satellite 6.3 it will just assign an empty OpenStruct object.

3) Edit /usr/share/foreman-proxy/lib/proxy/pluggable.rb file.

  attr_writer :settings
  def settings
    @settings ||= Proxy::Settings.load_plugin_settings(plugin_default_settings, settings_file)   <=== Add this line that I copy from Satellite 6.2.15
    #@settings ||= OpenStruct.new   <==== Comment out this line
  end

4) Run it again. The plugin settings are loaded now

/usr/bin/smart-proxy-openscap-send
Plugin settings: {:enabled=>true, :spooldir=>"/var/spool/foreman-proxy/openscap", :openscap_send_log_file=>"/var/log/foreman-proxy/openscap-send-22222222.log", :contentdir=>"/var/lib/foreman-proxy/openscap/content", :reportsdir=>"/var/lib/foreman-proxy/openscap/reports", :failed_dir=>"/var/lib/foreman-proxy/openscap/failed", :tailoring_dir=>"/usr/share/foreman-proxy/lib/../openscap/tailoring", :corrupted_dir=>"/var/lib/foreman-proxy/openscap/corrupted"}

Comment 1 Ondřej Pražák 2018-10-02 08:16:59 UTC
Thank you for reporting this bug, it is already tracked as #1542023 and fixed in 6.4, therefore I will close as a duplicate. Feel free to reopen if I misunderstood or if the problem persists in 6.4.

*** This bug has been marked as a duplicate of bug 1542023 ***


Note You need to log in before you can comment on or make changes to this bug.