mirror of
https://github.com/valitydev/salt.git
synced 2024-11-09 01:36:48 +00:00
Merge pull request #46029 from areaxx/develop
[#46028] do the version check with packaging AND classifier
This commit is contained in:
commit
60ee64af40
@ -223,7 +223,8 @@ def _get_snapshot_url(artifactory_url, repository, group_id, artifact_id, versio
|
||||
version=version)
|
||||
raise ArtifactoryError(error_message)
|
||||
|
||||
if has_classifier and classifier not in snapshot_version_metadata['snapshot_versions']:
|
||||
packaging_with_classifier = packaging if not has_classifier else packaging + ':' + classifier
|
||||
if has_classifier and packaging_with_classifier not in snapshot_version_metadata['snapshot_versions']:
|
||||
error_message = '''Cannot find requested classifier '{classifier}' in the snapshot version metadata.
|
||||
artifactory_url: {artifactory_url}
|
||||
repository: {repository}
|
||||
@ -241,7 +242,7 @@ def _get_snapshot_url(artifactory_url, repository, group_id, artifact_id, versio
|
||||
version=version)
|
||||
raise ArtifactoryError(error_message)
|
||||
|
||||
snapshot_version = snapshot_version_metadata['snapshot_versions'][packaging]
|
||||
snapshot_version = snapshot_version_metadata['snapshot_versions'][packaging_with_classifier]
|
||||
except CommandExecutionError as err:
|
||||
log.error('Could not fetch maven-metadata.xml. Assuming snapshot_version=%s.', version)
|
||||
snapshot_version = version
|
||||
@ -390,7 +391,7 @@ def _get_snapshot_version_metadata(artifactory_url, repository, group_id, artifa
|
||||
extension_version_dict[extension] = value
|
||||
if snapshot_version.find('classifier') is not None:
|
||||
classifier = snapshot_version.find('classifier').text
|
||||
extension_version_dict[classifier] = value
|
||||
extension_version_dict[extension + ':' + classifier] = value
|
||||
|
||||
return {
|
||||
'snapshot_versions': extension_version_dict
|
||||
|
Loading…
Reference in New Issue
Block a user