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

Fixed check mode for user and credential modules #14989

Open
wants to merge 3 commits into
base: devel
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
15 changes: 8 additions & 7 deletions awx_collection/plugins/module_utils/controller_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -890,16 +890,17 @@ def fields_could_be_same(old_field, new_field):
depending on the unknown $encrypted$ value or sub-values
"""
if isinstance(old_field, dict) and isinstance(new_field, dict):
if set(old_field.keys()) != set(new_field.keys()):
return False
for key in new_field.keys():
if not ControllerAPIModule.fields_could_be_same(old_field[key], new_field[key]):
return False
if key in old_field:
if not ControllerAPIModule.fields_could_be_same(old_field[key], new_field[key]):
return False
return True # all sub-fields are either equal or could be equal
else:
if old_field == ControllerAPIModule.ENCRYPTED_STRING:
return True
return bool(new_field == old_field)
if old_field is not None:
if old_field == ControllerAPIModule.ENCRYPTED_STRING:
return True
return bool(new_field == old_field)
return True

def objects_could_be_different(self, old, new, field_set=None, warning=False):
if field_set is None:
Expand Down
Loading