Bug #8333
closedIncorrect matcher values with multi-key matchers
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.
Updated by Ori Rabin about 10 years ago
- Status changed from New to Assigned
- Assignee set to Ori Rabin
Updated by The Foreman Bot about 10 years ago
- Status changed from Assigned to Ready For Testing
- Pull request https://github.com/theforeman/foreman/pull/1925 added
- Pull request deleted (
)
Updated by Dominic Cleal over 9 years ago
- Related to Bug #5554: Smart Class Parameter override matches throw error when matching on multiple matchers added
Updated by Ori Rabin over 9 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset a3d8204a4d7d2eb7355c149d602aa43e8de8aff4.
Updated by Dominic Cleal over 9 years ago
- Translation missing: en.field_release set to 50
Updated by Dominic Cleal over 9 years ago
- Related to Bug #11112: Matcher for unlisted attribute fails with "comparison of Array with Array failed" added