propagate original IOError message through file.manage_file

related to #21774
This commit is contained in:
Justin Findlay 2015-03-19 15:41:11 -06:00
parent f92fd17d46
commit ddbe16e002

View File

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