mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-08-29 01:11:43 -07:00
fixed not resolving latest to snapshot for MD5 check when the file ex…
This commit is contained in:
parent
a66a0187d1
commit
8a1aee53bc
1 changed files with 4 additions and 4 deletions
|
@ -195,15 +195,15 @@ class MavenDownloader:
|
||||||
return v[0]
|
return v[0]
|
||||||
|
|
||||||
def find_uri_for_artifact(self, artifact):
|
def find_uri_for_artifact(self, artifact):
|
||||||
|
if artifact.version == "latest":
|
||||||
|
artifact.version = self._find_latest_version_available(artifact)
|
||||||
|
|
||||||
if artifact.is_snapshot():
|
if artifact.is_snapshot():
|
||||||
path = "/%s/maven-metadata.xml" % (artifact.path())
|
path = "/%s/maven-metadata.xml" % (artifact.path())
|
||||||
xml = self._request(self.base + path, "Failed to download maven-metadata.xml", lambda r: etree.parse(r))
|
xml = self._request(self.base + path, "Failed to download maven-metadata.xml", lambda r: etree.parse(r))
|
||||||
timestamp = xml.xpath("/metadata/versioning/snapshot/timestamp/text()")[0]
|
timestamp = xml.xpath("/metadata/versioning/snapshot/timestamp/text()")[0]
|
||||||
buildNumber = xml.xpath("/metadata/versioning/snapshot/buildNumber/text()")[0]
|
buildNumber = xml.xpath("/metadata/versioning/snapshot/buildNumber/text()")[0]
|
||||||
return self._uri_for_artifact(artifact, artifact.version.replace("SNAPSHOT", timestamp + "-" + buildNumber))
|
return self._uri_for_artifact(artifact, artifact.version.replace("SNAPSHOT", timestamp + "-" + buildNumber))
|
||||||
else:
|
|
||||||
if artifact.version == "latest":
|
|
||||||
artifact.version = self._find_latest_version_available(artifact)
|
|
||||||
|
|
||||||
return self._uri_for_artifact(artifact, artifact.version)
|
return self._uri_for_artifact(artifact, artifact.version)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue