mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 17:33:54 +00:00
Update message for invalid source_hash
This commit is contained in:
parent
2d20d71bd5
commit
53fdf0bf97
@ -3358,18 +3358,19 @@ def get_managed(
|
||||
source_hash)
|
||||
source_sum = extract_hash(hash_fn, '', name)
|
||||
if source_sum is None:
|
||||
return '', {}, ('Source hash file {0} contains an invalid '
|
||||
'hash format, it must be in the format <hash type>=<hash>.'
|
||||
).format(source_hash)
|
||||
return '', {}, ('Source hash {0} format is invalid. It '
|
||||
'must be in the format, <hash type>=<hash>, or it '
|
||||
'must be a supported protocol: {1}'
|
||||
).format(source_hash, ', '.join(protos))
|
||||
|
||||
else:
|
||||
# The source_hash is a hash string
|
||||
comps = source_hash.split('=')
|
||||
if len(comps) < 2:
|
||||
return '', {}, ('Source hash file {0} contains an '
|
||||
'invalid hash format, it must be in '
|
||||
'the format <hash type>=<hash>'
|
||||
).format(source_hash)
|
||||
return '', {}, ('Source hash {0} format is invalid. It '
|
||||
'must be in the format, <hash type>=<hash>, or it '
|
||||
'must be a supported protocol: {1}'
|
||||
).format(source_hash, ', '.join(protos))
|
||||
source_sum['hsum'] = comps[1].strip()
|
||||
source_sum['hash_type'] = comps[0].strip()
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user