Project

General

Profile

Actions

Bug #8333

closed

Incorrect matcher values with multi-key matchers

Added by Jeff Sault about 10 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Parameters
Target version:
Difficulty:
Triaged:
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 2 (1 open1 closed)

Related to Foreman - Bug #5554: Smart Class Parameter override matches throw error when matching on multiple matchersClosedOri Rabin05/02/2014Actions
Related to Foreman - Bug #11112: Matcher for unlisted attribute fails with "comparison of Array with Array failed"New07/14/2015Actions
Actions

Also available in: Atom PDF