This commit is contained in:
SuperPommeDeTerre 2017-08-17 11:56:23 +02:00 committed by Jérémie Langlade
parent 82be9dceb6
commit db11e1985b

View File

@ -202,8 +202,8 @@ def _get_snapshot_url(artifactory_url, repository, group_id, artifact_id, versio
has_classifier = classifier is not None and classifier != ""
if snapshot_version is None:
try:
snapshot_version_metadata = _get_snapshot_version_metadata(artifactory_url=artifactory_url, repository=repository, group_id=group_id, artifact_id=artifact_id, version=version, headers=headers)
if packaging not in snapshot_version_metadata['snapshot_versions']:
error_message = '''Cannot find requested packaging '{packaging}' in the snapshot version metadata.
artifactory_url: {artifactory_url}
@ -241,6 +241,9 @@ def _get_snapshot_url(artifactory_url, repository, group_id, artifact_id, versio
raise ArtifactoryError(error_message)
snapshot_version = snapshot_version_metadata['snapshot_versions'][packaging]
except CommandExecutionError as err:
log.error('Could not fetch maven-metadat.xml. Assuming snapshot_version=%s.', version)
snapshot_version = version
group_url = __get_group_id_subpath(group_id)