Skip to content

Commit

Permalink
maven_artifact: Convert MD5 values to lowercase before comparison (#197)
Browse files Browse the repository at this point in the history
Fixes: #186

Signed-off-by: Abhijeet Kasurde <[email protected]>
  • Loading branch information
Akasurde authored Apr 17, 2020
1 parent 406d325 commit 2639d4c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/186-maven_artifact.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- Convert MD5SUM to lowercase before comparison in maven_artifact module (https://github.com/ansible-collections/community.general/issues/186).
6 changes: 3 additions & 3 deletions plugins/modules/packaging/language/maven_artifact.py
Original file line number Diff line number Diff line change
Expand Up @@ -519,12 +519,12 @@ def is_invalid_md5(self, file, remote_url):
remote_md5 = _remote_md5
# remote_md5 is empty so we continue and keep original md5 string
# This should not happen since we check for remote_md5 before
except IndexError as e:
except IndexError:
pass
if local_md5 == remote_md5:
if local_md5.lower() == remote_md5.lower():
return None
else:
return "Checksum does not match: we computed " + local_md5 + "but the repository states " + remote_md5
return "Checksum does not match: we computed " + local_md5 + " but the repository states " + remote_md5

return "Path does not exist: " + file

Expand Down

0 comments on commit 2639d4c

Please sign in to comment.