mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 17:33:54 +00:00
propagate original IOError message through file.manage_file
related to #21774
This commit is contained in:
parent
f92fd17d46
commit
ddbe16e002
@ -3158,10 +3158,10 @@ def manage_file(name,
|
||||
real_name,
|
||||
__salt__['config.backup_mode'](backup),
|
||||
__opts__['cachedir'])
|
||||
except IOError:
|
||||
except IOError as io_error:
|
||||
__clean_tmp(sfn)
|
||||
return _error(
|
||||
ret, 'Failed to commit change, permission error')
|
||||
ret, 'Failed to commit change: {0}'.format(io_error))
|
||||
|
||||
if contents is not None:
|
||||
# Write the static contents to a temporary file
|
||||
@ -3196,10 +3196,10 @@ def manage_file(name,
|
||||
real_name,
|
||||
__salt__['config.backup_mode'](backup),
|
||||
__opts__['cachedir'])
|
||||
except IOError:
|
||||
except IOError as io_error:
|
||||
__clean_tmp(tmp)
|
||||
return _error(
|
||||
ret, 'Failed to commit change, permission error')
|
||||
ret, 'Failed to commit change: {0}'.format(io_error))
|
||||
__clean_tmp(tmp)
|
||||
|
||||
# check for changing symlink to regular file here
|
||||
@ -3227,10 +3227,10 @@ def manage_file(name,
|
||||
name,
|
||||
__salt__['config.backup_mode'](backup),
|
||||
__opts__['cachedir'])
|
||||
except IOError:
|
||||
except IOError as io_error:
|
||||
__clean_tmp(sfn)
|
||||
return _error(
|
||||
ret, 'Failed to commit change, permission error')
|
||||
ret, 'Failed to commit change: {0}'.format(io_error))
|
||||
|
||||
ret['changes']['diff'] = \
|
||||
'Replace symbolic link with regular file'
|
||||
|
Loading…
Reference in New Issue
Block a user