ansible/lib
Pascal Grange 8b08a28c89 fixes issue #13981: unsafe_writes block appeared too late in the atom… (#17405)
* fixes issue #13981: unsafe_writes block appeared too late in the atomic_move
workflow. This led to errno.EBUSY to not be managed in the context of
issue #!#981

* Reduce changes to fix #13981

* Abstract the unsafe_writes fallback into a helper method.
Explicitly try/except os.rename part of the code and call this helper method.
If the code fails in shutil.copy2 or shutil.move this should not be related to issue #13981
since they write to b_tmp_dest_name.
(as suggested by @abadger)

* Check if unsafe_writes in the caller, not in _unsafe_writes.
That way the function call reads as "Do an unsafe write"
and not as "I think we should do an unsafe_write.
2016-09-22 11:31:35 -04:00
..
ansible fixes issue #13981: unsafe_writes block appeared too late in the atom… (#17405) 2016-09-22 11:31:35 -04:00