diff --git a/plugins/module_utils/controller.py b/plugins/module_utils/controller.py index 553c7969..50655df5 100644 --- a/plugins/module_utils/controller.py +++ b/plugins/module_utils/controller.py @@ -242,6 +242,7 @@ def fields_could_be_same(old_field: Any, new_field: Any) -> bool: return True # all sub-fields are either equal or could be equal if old_field == Controller.ENCRYPTED_STRING: return True + return bool(new_field == old_field) def objects_could_be_different( @@ -256,13 +257,14 @@ def objects_could_be_different( for field in field_set: new_field = new.get(field, None) old_field = old.get(field, None) + if old_field != new_field: if self.update_secrets or ( not self.fields_could_be_same(old_field, new_field) ): return True # Something doesn't match, or something # might not match - elif self.has_encrypted_values(new_field) or field not in new: + elif self.has_encrypted_values(new_field): if self.update_secrets or ( not self.fields_could_be_same(old_field, new_field) ): diff --git a/tests/integration/targets/credential/tasks/main.yml b/tests/integration/targets/credential/tasks/main.yml index d537a994..4a610ec4 100644 --- a/tests/integration/targets/credential/tasks/main.yml +++ b/tests/integration/targets/credential/tasks/main.yml @@ -82,12 +82,10 @@ organization_name: Default register: _result - # [WARNING]: The field inputs of unknown 3 has encrypted data and may inaccurately report task is changed. - name: Check credential is not created again assert: that: - not _result.changed - ignore_errors: true - name: Get info about a credential ansible.eda.credential_info: @@ -121,7 +119,6 @@ organization_name: Default register: _result - # [WARNING]: The field inputs of unknown 3 has encrypted data and may inaccurately report task is changed. - name: Check credential is not updated again assert: that: diff --git a/tests/integration/targets/event_stream/tasks/main.yml b/tests/integration/targets/event_stream/tasks/main.yml index f023f243..aee1dfd9 100644 --- a/tests/integration/targets/event_stream/tasks/main.yml +++ b/tests/integration/targets/event_stream/tasks/main.yml @@ -76,13 +76,10 @@ organization_name: Default register: _result - # [WARNING]: The field eda_credential_id of unknown 2 has encrypted data and may - # inaccurately report task is changed. - name: Check event stream is not created again assert: that: - not _result.changed - ignore_errors: true - name: Get info about an event stream ansible.eda.event_stream_info: @@ -110,13 +107,10 @@ organization_name: Default register: _result - # [WARNING]: The field eda_credential_id of unknown 5 has encrypted data and may - # inaccurately report task is changed. - name: Check event stream is not updated again assert: that: - not _result.changed - ignore_errors: true - name: Get info about event stream ansible.eda.event_stream_info: