fixes to vault/copy

rm _del_ as it might leak memory
renamed to tmp file cleanup
added exception handling when traversing file list, even if one fails try rest
added cleanup to finally to ensure removal in most cases
This commit is contained in:
Brian Coca 2016-04-14 10:31:39 -04:00
parent cdf6e3e4bf
commit 5940d3d45b
5 changed files with 18 additions and 13 deletions

View file

@ -220,8 +220,7 @@ class ActionModule(ActionBase):
# We have copied the file remotely and no longer require our content_tempfile
self._remove_tempfile_if_content_defined(content, content_tempfile)
self._loader.cleanup_real_file(source_full)
self._loader.cleanup_tmp_file(source_full)
# fix file permissions when the copy is done as a different user
self._fixup_perms(tmp, remote_user, recursive=True)
@ -250,8 +249,7 @@ class ActionModule(ActionBase):
# no need to transfer the file, already correct hash, but still need to call
# the file module in case we want to change attributes
self._remove_tempfile_if_content_defined(content, content_tempfile)
self._loader.cleanup_real_file(source_full)
self._loader.cleanup_tmp_file(source_full)
if raw:
# Continue to next iteration if raw is defined.