Bug 1218792

Summary: Kafo do not run hooks in expected order on ruby 1.8
Product: Red Hat Satellite Reporter: Martin Bacovsky <mbacovsk>
Component: InstallationAssignee: Martin Bacovsky <mbacovsk>
Status: CLOSED CURRENTRELEASE QA Contact: jcallaha
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.1.0CC: bkearney, cwelton, jmatthew, mbacovsk
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
URL: http://projects.theforeman.org/issues/10390
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-08-12 16:04:57 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1212602    

Description Martin Bacovsky 2015-05-05 21:43:59 UTC
Description of problem:
When there is more installer hooks in one category (e.g. 'pre-validation') Kafo is supposed to execute them in alphabetical order. That does not happen on Ruby 1.8 and the order is unpredictable.

Version-Release number of selected component (if applicable):


How reproducible:
Sometimes

Steps to Reproduce:
1. add hooks to one hook category that are just logging something 
2. run installer multiple times on system with ruby 1.8
3. the order in log differs

Actual results:


Expected results:
The hooks are executed in alphabetical order

Additional info:
AFAIK we do not have hooks that depend on the order in Sat 6, I hit this issue while adding hooks for RHCI

Comment 2 Martin Bacovsky 2015-05-06 07:24:51 UTC
Created redmine issue http://projects.theforeman.org/issues/10390 from this bug

Comment 3 Bryan Kearney 2015-05-06 10:06:12 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/10390 has been closed
-------------
Anonymous
Applied in changeset commit:60ee71a95120d39f471e19c52de0a2be16d19a06.

Comment 4 Bryan Kearney 2015-05-12 14:36:27 UTC
commit 071edf64dec68a042360d49377739aa0789f6fca
Author: Martin Bačovský <martin.bacovsky>
Date:   Wed May 6 09:44:27 2015 +0200

    Fixes #10390 - Hooks within group are executed in right order
    
    (cherry picked from commit 60ee71a95120d39f471e19c52de0a2be16d19a06)

Comment 6 jcallaha 2015-07-27 13:35:37 UTC
Is this something that needs to be tested by dev? When I attempt to test manually on a Satellite system, I run into [1]. When I test on a newly provisioned system, I run into puppet dependency issues, namely with puppet-stdlib methods.

[1] - https://bugzilla.redhat.com/show_bug.cgi?id=1235804

Comment 7 Martin Bacovsky 2015-07-27 15:07:02 UTC
I tested it with two custom boot hooks like the following:

# cat /usr/share/foreman-installer/hooks/boot/02.rb 
puts 'second'

# cat /usr/share/foreman-installer/hooks/boot/01.rb 
puts 'first'

Then the foreman-installer -h should print the strings in the order according to hook name.

# foreman-installer -h                              
first
second
Usage:
    foreman-installer [OPTIONS]
...

Comment 8 jcallaha 2015-07-27 15:46:00 UTC
Verified in Satellite 6.1 GA14

This is primarily a dev task with no directly customer-facing functionality. However, I was able to reproduce the output given above by Martin.

Comment 9 Bryan Kearney 2015-08-12 16:04:57 UTC
This bug was fixed in Satellite 6.1.1 which was delivered on 12 August, 2015.