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
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions plugins/modules/ntnx_acps.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

if context not in old_context_list:
return False

return True


Expand Down