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 1365820 - Document "report" renamed to "config_report" for foreman hooks plugin (6.2 upgrade step)
Summary: Document "report" renamed to "config_report" for foreman hooks plugin (6.2 up...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Docs Install Guide
Version: 6.2.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: Unspecified
Assignee: Stephen Wadeley
QA Contact: Brandi Munilla
URL:
Whiteboard:
Depends On:
Blocks: GSS_Sat6Beta_Tracker, GSS_Sat6_Tracker
TreeView+ depends on / blocked
 
Reported: 2016-08-10 09:40 UTC by Javier Ramirez
Modified: 2021-08-30 10:42 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Known Issue
Doc Text:
Rails events no longer triggering hooks in /hooks/report In Satellite 6.2 the Report class is changed to ConfigReport so the hooks are no longer looking for a script stored in the /hooks/report/ directory. Create a directory /usr/share/foreman/config/hooks/config_report/ and move hooks such as `after_create` and `before_create` to the new directory.
Clone Of:
Environment:
Last Closed: 2016-09-26 06:23:26 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 2491841 0 None None None 2016-08-10 09:46:16 UTC

Description Javier Ramirez 2016-08-10 09:40:09 UTC
Description of problem:
After upgrading to 6.2 report 'after_create' hook no longer running.

Version-Release number of selected component (if applicable):
tfm-rubygem-foreman_hooks-0.3.11-1.el7sat.noarch

How reproducible:
Always

Steps to Reproduce:
1. Create /usr/share/foreman/config/hooks/report/after_create/10-test with the following content

#!/bin/sh

logger "Testing after_create hooks"

exit 0

2. Use puppet to trigger the hook execution in a client:

puppet agent -t --server satellite.example.com

Actual results:

The hook is not executed.

Expected results:

The hook to be executed.

Additional info:

In 6.2 Report class is changed into ConfigReport so the hooks are not looking into the script which is stored into report directory.

So if you create /usr/share/foreman/config/hooks/config_report/after_create/10-test 

It works.

Comment 1 Javier Ramirez 2016-08-10 09:46:16 UTC
I'm marking this as a regression since this change made code working on previous versions unusable.

This change is also undocumented, so there is no way that customers could ammend their hooks.

I suspect that this is going to be a general issue, since many customers will be using their own scripts for after_create hooks.

Comment 2 Lukas Zapletal 2016-08-11 08:18:16 UTC
Thanks, I confirm. This is good DOCO ERRATA candidate for specific 6.2 upgrade instructions.

Comment 3 Andrew Dahms 2016-09-13 01:16:51 UTC
Assigning to Stephen for review.

Stephen - given the nature of this bug, one approach that comes to mind is to describe the issue in the doc text field and make this a known issue release note so that it is called out there.

What do you think?

Comment 5 Stephen Wadeley 2016-09-13 10:52:08 UTC
report(In reply to Andrew Dahms from comment #3)
> Assigning to Stephen for review.
> 
> Stephen - given the nature of this bug, one approach that comes to mind is
> to describe the issue in the doc text field and make this a known issue
> release note so that it is called out there.
> 
> What do you think?

Hello

I agree, I think that is essential.

I greped all the guides, I could not find "hooks/report", which suggests there is no example or procedure that needs correcting.

I found `after_create` mentioned in "Rails Events" under "Using Foreman Hooks" in the Server Administration Guide[1]

But if you scroll up and look at the end of "Procedure 10.1. Creating a Foreman Hook to Use the logger Command" you will see:


This command output also lists some technical tables which are unlikely to be used with Foreman Hooks, for example "active_record" or "habtm". These are most commonly used:

    host
    report 

I think that is the "report" in question. 

[1] https://access.redhat.com/documentation/en/red-hat-satellite/6.2/paged/server-administration-guide/102-using-foreman-hooks#sect-Red_Hat_Satellite-Server_Administration_Guide-Red_Hat_Satellite_Foreman_Hooks_Rails_Events

Comment 6 Stephen Wadeley 2016-09-13 11:02:10 UTC
(In reply to Stephen Wadeley from comment #5)
> report(In reply to Andrew Dahms from comment #3)
> > Assigning to Stephen for review.
> > 
<snip>

> 
> This command output also lists some technical tables which are unlikely to
> be used with Foreman Hooks, for example "active_record" or "habtm". These
> are most commonly used:
> 
>     host
>     report 
> 
> I think that is the "report" in question. 
> 
In my test VM for Sat6.2.1

I started foreman-rake console and entered:
ActiveRecord::Base.descendants.collect(&:name).collect(&:underscore).sort

in the output I see "config_report" and later just "report". So now I am unsure.

Comment 10 Stephen Wadeley 2016-09-15 09:12:12 UTC
Hello lzap

Can you read comment 5 and see if there is anything more I should add or change in the guide at the link provided?

Is there someone else I should ask about this?


Thank you

Comment 11 Lukas Zapletal 2016-09-22 11:19:13 UTC
No this is right, make it an Upgrade note for 6.2 only. It's really only ConfigReport model that was renamed, nothing else AFAIK.

Comment 12 Stephen Wadeley 2016-09-22 13:50:58 UTC
Thank you lzap

I have added some text to the "Upgrading Satellite Server and Capsule Server" with title "Foreman Hooks' Report Class Renamed to ConfigReport"


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