Support local files without md5sum

see issue #25983
This commit is contained in:
James Michael DuPont 2015-08-03 16:32:42 -05:00 committed by rallytime
parent 0d3c2d549e
commit cced16a9f4

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 '