Project

General

Profile

Bug #8333

Incorrect matcher values with multi-key matchers

Added by Jeff Sault almost 7 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Parameters
Target version:
Difficulty:
Triaged:
Bugzilla link:
Fixed in Releases:
Found in Releases:

Description

As discussed with Ohad on the mailing list (https://groups.google.com/forum/#!topic/foreman-users/f2YrbR3_FPY)

I have created a custom fact called 'all_environments' which is always "true" (string). My matcher order for a parametised class is...

fqdn
hostgroup
environment
all_environments
environment,all_environments

overriding at the pure 'environment' level works but if i create a matcher (all_environments=true) i get the value from the 'environment,all_environments' matcher.

Doing more tests it seems that matchers with multiple keys are fundamentally broken and very rarely return what's expected, another test case with the same matcher order and the following matches:

- all_environments=true value1
- environment=production,all_environments=true value2

In this case I would expect 'value1' to be returned. I actually get 'value2'

If i change the matchers to:

- all_environments=true value1
- environment=production,all_environments=nottrue value2

Now I get 'value1' returned, as expected.


Related issues

Related to Foreman - Bug #5554: Smart Class Parameter override matches throw error when matching on multiple matchersClosed2014-05-02
Related to Foreman - Bug #11112: Matcher for unlisted attribute fails with "comparison of Array with Array failed"New2015-07-14

Associated revisions

Revision a3d8204a (diff)
Added by Ori Rabin over 6 years ago

Fixes #8333 - correct matcher values with multi-key matchers

Revision 30f35f16 (diff)
Added by Ori Rabin over 6 years ago

Fixes #8333 - correct matcher values with multi-key matchers

(cherry picked from commit a3d8204a4d7d2eb7355c149d602aa43e8de8aff4)

History

#1 Updated by Dominic Cleal almost 7 years ago

  • Category set to Parameters

#2 Updated by Ori Rabin almost 7 years ago

  • Status changed from New to Assigned
  • Assignee set to Ori Rabin

#3 Updated by The Foreman Bot almost 7 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/1925 added
  • Pull request deleted ()

#4 Updated by Dominic Cleal over 6 years ago

  • Related to Bug #5554: Smart Class Parameter override matches throw error when matching on multiple matchers added

#5 Updated by Ori Rabin over 6 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#6 Updated by Dominic Cleal over 6 years ago

  • Legacy Backlogs Release (now unused) set to 50

#7 Updated by Dominic Cleal about 6 years ago

  • Related to Bug #11112: Matcher for unlisted attribute fails with "comparison of Array with Array failed" added

Also available in: Atom PDF