Skip to content

Fix identical inventory queries with different flags returning incorrect data#94

Merged
epcim merged 1 commit intodevelopfrom
andrewp-fix-inv-query-overwriting
Sep 26, 2020
Merged

Fix identical inventory queries with different flags returning incorrect data#94
epcim merged 1 commit intodevelopfrom
andrewp-fix-inv-query-overwriting

Conversation

@AndrewPickford
Copy link
Copy Markdown
Collaborator

With two identical inventory queries, one with the AllEnvs flag and one without both queries return the data from the query with the AllEnvs flag set.

Inventory queries use a pre calculated list of nodes to loop over to determine which nodes match the inventory query. If any inventory queries have the AllEnvs flag set then nodes from all environments will be present in the pre calculated list of nodes. Thus other queries which do not have the AllEnvs flags set could then match nodes from other environments.

The fix adds a test to the invitem class when assembling the inventory query result to check that the node environments match or that the query has the AllEnvs flag set. Unit tests are also added to check this functionality.

…rect data

With two indentical inventory queries, one with the AllEnvs flag and
one without both queries return the data from the query with the AllEnvs
flag set.

This fix adds a test to the invitem class when assembling the inventory
query result to check that the node environments match or that the
query has the AllEnvs flag set.
@epcim epcim merged commit e25dc93 into develop Sep 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants