mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #38503 from jinm/issue_38472_jinm
Hash type fallback for file management
This commit is contained in:
commit
86f0aa0bb3
1 changed files with 2 additions and 2 deletions
|
@ -4468,12 +4468,12 @@ def manage_file(name,
|
|||
|
||||
# Only test the checksums on files with managed contents
|
||||
if source and not (not follow_symlinks and os.path.islink(real_name)):
|
||||
name_sum = get_hash(real_name, source_sum['hash_type'])
|
||||
name_sum = get_hash(real_name, source_sum.get('hash_type', __opts__.get('hash_type', 'md5')))
|
||||
else:
|
||||
name_sum = None
|
||||
|
||||
# Check if file needs to be replaced
|
||||
if source and (name_sum is None or source_sum['hsum'] != name_sum):
|
||||
if source and (name_sum is None or source_sum.get('hsum', __opts__.get('hash_type', 'md5')) != name_sum):
|
||||
if not sfn:
|
||||
sfn = __salt__['cp.cache_file'](source, saltenv)
|
||||
if not sfn:
|
||||
|
|
Loading…
Add table
Reference in a new issue