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,45 +202,48 @@ def _get_snapshot_url(artifactory_url, repository, group_id, artifact_id, versio
has_classifier = classifier is not None and classifier != "" has_classifier = classifier is not None and classifier != ""
if snapshot_version is None: if snapshot_version is None:
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) 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}
repository: {repository}
group_id: {group_id}
artifact_id: {artifact_id}
packaging: {packaging}
classifier: {classifier}
version: {version}'''.format(
artifactory_url=artifactory_url,
repository=repository,
group_id=group_id,
artifact_id=artifact_id,
packaging=packaging,
classifier=classifier,
version=version)
raise ArtifactoryError(error_message)
if packaging not in snapshot_version_metadata['snapshot_versions']: if has_classifier and classifier not in snapshot_version_metadata['snapshot_versions']:
error_message = '''Cannot find requested packaging '{packaging}' in the snapshot version metadata. error_message = '''Cannot find requested classifier '{classifier}' in the snapshot version metadata.
artifactory_url: {artifactory_url} artifactory_url: {artifactory_url}
repository: {repository} repository: {repository}
group_id: {group_id} group_id: {group_id}
artifact_id: {artifact_id} artifact_id: {artifact_id}
packaging: {packaging} packaging: {packaging}
classifier: {classifier} classifier: {classifier}
version: {version}'''.format( version: {version}'''.format(
artifactory_url=artifactory_url, artifactory_url=artifactory_url,
repository=repository, repository=repository,
group_id=group_id, group_id=group_id,
artifact_id=artifact_id, artifact_id=artifact_id,
packaging=packaging, packaging=packaging,
classifier=classifier, classifier=classifier,
version=version) version=version)
raise ArtifactoryError(error_message) raise ArtifactoryError(error_message)
if has_classifier and classifier not in snapshot_version_metadata['snapshot_versions']: snapshot_version = snapshot_version_metadata['snapshot_versions'][packaging]
error_message = '''Cannot find requested classifier '{classifier}' in the snapshot version metadata. except CommandExecutionError as err:
artifactory_url: {artifactory_url} log.error('Could not fetch maven-metadat.xml. Assuming snapshot_version=%s.', version)
repository: {repository} snapshot_version = version
group_id: {group_id}
artifact_id: {artifact_id}
packaging: {packaging}
classifier: {classifier}
version: {version}'''.format(
artifactory_url=artifactory_url,
repository=repository,
group_id=group_id,
artifact_id=artifact_id,
packaging=packaging,
classifier=classifier,
version=version)
raise ArtifactoryError(error_message)
snapshot_version = snapshot_version_metadata['snapshot_versions'][packaging]
group_url = __get_group_id_subpath(group_id) group_url = __get_group_id_subpath(group_id)