diff --git a/changelogs/fragments/186-maven_artifact.yml b/changelogs/fragments/186-maven_artifact.yml new file mode 100644 index 0000000000..17b84bc6c5 --- /dev/null +++ b/changelogs/fragments/186-maven_artifact.yml @@ -0,0 +1,2 @@ +bugfixes: +- Convert MD5SUM to lowercase before comparison in maven_artifact module (https://github.com/ansible-collections/community.general/issues/186). diff --git a/plugins/modules/packaging/language/maven_artifact.py b/plugins/modules/packaging/language/maven_artifact.py index f1b5e2f3d3..30de44d3a7 100644 --- a/plugins/modules/packaging/language/maven_artifact.py +++ b/plugins/modules/packaging/language/maven_artifact.py @@ -519,12 +519,12 @@ class MavenDownloader: 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