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

Update ntnx_acps.py #476

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

stahnjones
Copy link

Adding missing check for new context list items, not just removing extra old ones

Adding missing check for new context list items, not just removing extra old ones
Bump up Ansible core version to 2.15.0 due to EOL of 2.14.0 (nutanix#478)
@@ -421,6 +421,10 @@ def check_acp_idempotency(old_spec, update_spec):
if context not in update_context_list:
return False

for context in update_context_list:
Copy link
Collaborator

@bhati-pradeep bhati-pradeep Jul 25, 2024

Choose a reason for hiding this comment

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

Thanks for pointing it out. Btw can this be solved by comparing length of old and new context list in initially instead of this new loop added?

Copy link
Author

Choose a reason for hiding this comment

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

it could possibly be solved that way, but what if the length of the list doesn't change but the contents do? i.e. remove one bad entry and add a new replacement one

Copy link
Collaborator

@bhati-pradeep bhati-pradeep Aug 2, 2024

Choose a reason for hiding this comment

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

Previous for loop should take care of that. It will not find that one bad entry from old_context_list in new_context_list, which will detect the change in context lists.

And length check initially will detect new additions to context_lists

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