Bug 1320492

Summary: Discovery Rules should run on priority basis, the rule with higher priority should execute first
Product: Red Hat Satellite 6 Reporter: Sachin Ghai <sghai>
Component: Discovery PluginAssignee: Lukas Zapletal <lzap>
Status: CLOSED ERRATA QA Contact: Sachin Ghai <sghai>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.2.0CC: ehelms
Target Milestone: Unspecified   
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
URL: http://projects.theforeman.org/issues/13217
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-27 09:28:33 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:
Description Flags
rule having '0' priority should be applied first instead of rule with priority '1'
rule2 has priority '0' and 2 hosts provisioned with same rule none

Description Sachin Ghai 2016-03-23 10:49:08 UTC
Created attachment 1139506 [details]
rule having '0' priority  should be applied first instead of rule with priority '1'

Description of problem: I created two discovery rules.
1) rule1 with priority '1'
2) rule2 with priority '0'

but when I auto provision a discovered host, host always provisioned with rule1.

As we know, the 'lower integer means higher priority' so I think rule2 should apply first instead of rule1.

Version-Release number of selected component (if applicable):
Sat6.2 beta snap4

How reproducible:

Steps to Reproduce:
1. create discovery rule 1 with priority '1'
2. create another rule 2 with priority '0'
3. discovered a host and auto provision via rule

Actual results:
host provisioned with rule 1

Expected results:
since '0' integer has higher priority so, host should provision via rule'2'

Additional info:

Comment 3 Bryan Kearney 2016-03-23 13:33:12 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/13217 has been closed
Lukas Zapletal
For the record, I am clearing our documentation which was also a bit fuzzy around this: https://github.com/theforeman/theforeman.org/pull/556
Applied in changeset commit:foreman_discovery|b1d5689467aa42c699c5e3a4904a2d278dbf8a31.

Comment 7 Sachin Ghai 2016-04-01 11:28:07 UTC
Verified with sat6.2 beta snap6

Now rule with lower priority applied first. The reported issue has been fixed. Please see the attached screenshot for verification, where two hosts were auto provisioned by rule2 who has priority '0' set

Comment 8 Sachin Ghai 2016-04-01 11:29:40 UTC
Created attachment 1142514 [details]
rule2 has priority '0' and 2 hosts provisioned with same rule

Comment 10 errata-xmlrpc 2016-07-27 09:28:33 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.