Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix usage of compare_list_reduced variable #721

Merged
merged 2 commits into from
Nov 19, 2023

Conversation

Rickmarges
Copy link
Contributor

@Rickmarges Rickmarges commented Nov 6, 2023

What does this PR do?

The object diff plugin used the wrong variable in 1 place when using with_present.
When using that option, the state: present key is added to the compare_list_reduced dict, however, the compare_list was then extended and returned.

This also solves removing too much differences based on the if-statement on line 332 as less dict now have less than 3 keys

How should this be tested?

Manual

  1. Create list of roles to configure (for example: {"controller_roles": [{"team": "dummy", "job_template": "dummy_template", "role": "read"}]
  2. Run the diff role with include_present_state: true
  3. The diff output now actually contains the state: present key. Before it did not

Is there a relevant Issue open for this?

Other Relevant info, PRs, etc

@ivarmu ivarmu added bug Something isn't working enhancement New feature or request new New issue, this should be removed once reviewed labels Nov 8, 2023
Copy link
Contributor

@ivarmu ivarmu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ivarmu ivarmu removed the new New issue, this should be removed once reviewed label Nov 8, 2023
Copy link
Collaborator

@sean-m-sullivan sean-m-sullivan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry this took a bit for me to get to and review wanted to test and step through it, thanks!

@sean-m-sullivan sean-m-sullivan merged commit 0609b69 into redhat-cop:devel Nov 19, 2023
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants