mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #25383 from jahamn/Fix-file.managed_not_handling_dead_symlinks
Fix manage_file function in salt/modules/file.py to handle broken sym…
This commit is contained in:
commit
47bcc61f55
1 changed files with 4 additions and 2 deletions
|
@ -3380,11 +3380,13 @@ def manage_file(name,
|
|||
real_name = name
|
||||
|
||||
# Only test the checksums on files with managed contents
|
||||
if source:
|
||||
if source and not (not follow_symlinks and os.path.islink(real_name)):
|
||||
name_sum = get_hash(real_name, source_sum['hash_type'])
|
||||
else:
|
||||
name_sum = None
|
||||
|
||||
# Check if file needs to be replaced
|
||||
if source and source_sum['hsum'] != name_sum:
|
||||
if source and (source_sum['hsum'] != name_sum or name_sum == None):
|
||||
if not sfn:
|
||||
sfn = __salt__['cp.cache_file'](source, saltenv)
|
||||
if not sfn:
|
||||
|
|
Loading…
Add table
Reference in a new issue