fix error in module iam_server_certificate for _compare_cert #2104
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
SUMMARY
While using the module
iam_server_certificate
, I discovered that the module does not properly compare an existing certificate with the passed value. This happens because thestr.replace
method does not replace the variable in-place, but returns the string after replacement.ISSUE TYPE
COMPONENT NAME
iam_server_certificate
ADDITIONAL INFORMATION
To reproduce the error, run the module or include it in a playbook. Assuming the module's arguments remain the same, the first run of the playbook will succeed. The second run will fail with the message "Modifying the certificate body is not supported by AWS". The expected result should be a success, not changed.