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:
Mike Place 2015-07-13 14:58:23 -06:00
commit 47bcc61f55

View file

@ -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: