community.general/lib/ansible/modules/files
Mark Mielke b4a1542670 Reduce the system calls performed by the "file" module
when using "state: link", and particularly when using
"force: yes".

Symbolic link resolution can be expensive. In our case,
the symbolic links are legacy links to automounts, and
the "file" task was causing all of the legacy links to
be traversed and mounted on every host every time the
task executed, even when the links were correct and there
was nothing to do.

This change avoids the system calls that perform the
symbolic link resolution by taking advantage of the short
circuit behaviur of the boolean "and" operator. The code
behaviour is unchanged except that it no longer performs
unnecessary system calls.

As it turns out, this change is not sufficient to fully
solve the symbolic link resolution problem, as the "file"
module still performs a stat() at the end of execution to
provide the caller with information about the file.
However, this change is very simple, it will eliminate
unnecessary system calls in a number of use cases, and it
gets the "file" module closer to the desired end result.
2017-01-24 12:31:25 -08:00
..
__init__.py
acl.py Consistent path attribute for file-related modules 2017-01-13 15:49:42 -05:00
archive.py Relocating extras into lib/ansible/modules/ after merge 2016-12-08 11:35:18 -05:00
assemble.py
blockinfile.py Consistent path attribute for file-related modules 2017-01-13 15:49:42 -05:00
copy.py
fetch.py
file.py Reduce the system calls performed by the "file" module 2017-01-24 12:31:25 -08:00
find.py Fix code-blocks to use correct syntax highlighting 2017-01-08 09:18:45 -08:00
ini_file.py minor doc fix 2017-01-17 10:16:32 -05:00
lineinfile.py Correct typos. (#20490) 2017-01-20 08:03:49 -05:00
patch.py files/patch: improve examples (#20463) 2017-01-19 17:13:09 +00:00
replace.py Consistent path attribute for file-related modules 2017-01-13 15:49:42 -05:00
stat.py
synchronize.py
tempfile.py Relocating extras into lib/ansible/modules/ after merge 2016-12-08 11:35:18 -05:00
template.py Fix typo in my example (#20293) 2017-01-16 14:12:34 +00:00
unarchive.py fix https://github.com/ansible/ansible/issues/20183 (#20217) 2017-01-16 21:05:54 -05:00
xattr.py Consistent path attribute for file-related modules 2017-01-13 15:49:42 -05:00