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

[PR #7125/77214203 backport][stable-6] Fix inappropriate comparison on the length of a Collection #7146

Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions changelogs/fragments/7125-fix-inappropriate-comparison.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- oci_utils module util - fix inappropriate logical comparison expressions and makes them simpler. The previous checks had logical short circuits (https://github.com/ansible-collections/community.general/pull/7125).
7 changes: 2 additions & 5 deletions plugins/module_utils/oracle/oci_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ def are_lists_equal(s, t):
if s is None and t is None:
return True

if (s is None and len(t) >= 0) or (t is None and len(s) >= 0) or (len(s) != len(t)):
if s is None or t is None or (len(s) != len(t)):
return False

if len(s) == 0:
Expand Down Expand Up @@ -1026,10 +1026,7 @@ def check_if_user_value_matches_resources_attr(
return

if (
resources_value_for_attr is None
and len(user_provided_value_for_attr) >= 0
or user_provided_value_for_attr is None
and len(resources_value_for_attr) >= 0
resources_value_for_attr is None or user_provided_value_for_attr is None
):
res[0] = False
return
Expand Down