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.