Merge pull request #26101 from rallytime/bp-25984

Back-port #25984 to 2015.5
This commit is contained in:
Mike Place 2015-08-07 12:56:26 -06:00
commit 40d41741c1

View file

@ -3555,10 +3555,10 @@ def manage_file(name,
sfn = __salt__['cp.cache_file'](source, saltenv)
if not sfn:
return _error(
ret, 'Source file {0} not found'.format(source))
# If the downloaded file came from a non salt server source verify
# that it matches the intended sum value
if _urlparse(source).scheme != 'salt':
ret, 'Source file {0!r} not found'.format(source))
# If the downloaded file came from a non salt server or local source
# verify that it matches the intended sum value
if _urlparse(source).scheme not in ('salt', ''):
dl_sum = get_hash(sfn, source_sum['hash_type'])
if dl_sum != source_sum['hsum']:
ret['comment'] = ('File sum set for file {0} of {1} does '