Update message for invalid source_hash

This commit is contained in:
Loren Gordon 2015-12-01 11:59:12 -05:00
parent 2d20d71bd5
commit 53fdf0bf97

View File

@ -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: