Skip to content

fix: facts being gathered unnecessarily#106

Merged
spetrosi merged 1 commit intolinux-system-roles:mainfrom
richm:sort-required-facts-plus-subsets
Jul 14, 2023
Merged

fix: facts being gathered unnecessarily#106
spetrosi merged 1 commit intolinux-system-roles:mainfrom
richm:sort-required-facts-plus-subsets

Conversation

@richm
Copy link
Copy Markdown
Contributor

@richm richm commented Jul 13, 2023

Cause: The comparison of the present facts with the required facts is
being done on unsorted lists.

Consequence: The comparison may fail if the only difference is the
order. Facts are gathered unnecessarily.

Fix: Use difference which works no matter what the order is. Ensure
that the fact gathering subsets used are the absolute minimum required.

Result: The role gathers only the facts it requires, and does
not unnecessarily gather facts.

Signed-off-by: Rich Megginson rmeggins@redhat.com

Cause: The comparison of the present facts with the required facts is
being done on unsorted lists.

Consequence: The comparison may fail if the only difference is the
order.  Facts are gathered unnecessarily.

Fix: Use `difference` which works no matter what the order is.  Ensure
that the fact gathering subsets used are the absolute minimum required.

Result: The role gathers only the facts it requires, and does
not unnecessarily gather facts.

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
@richm richm requested a review from Jakuje as a code owner July 13, 2023 21:40
@richm
Copy link
Copy Markdown
Contributor Author

richm commented Jul 14, 2023

[citest]

@spetrosi spetrosi merged commit 95a2ef2 into linux-system-roles:main Jul 14, 2023
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