mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #26101 from rallytime/bp-25984
Back-port #25984 to 2015.5
This commit is contained in:
commit
40d41741c1
1 changed files with 4 additions and 4 deletions
|
@ -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 '
|
||||
|
|
Loading…
Add table
Reference in a new issue