community.general/lib/ansible
Austin S. Hemmelgarn 50ceb8d7d8 wait_for: change file check to handle directories and sockets (#20979)
open(path) throws an error when called on a directory or UNIX socket,
and therefore a check to ensure that the path is absent will always
succeed when there is a directory or file located there.

This updates the check to use os.access(path, os.F_OK) instead, which
instead just checks that the path exists instead of trying to open it as
a file, and therefore properly handles directories and sockets.

This causes a slight semantic change in how permissions are handled.
The existing code will fail to work correctly if the user running the
module on the managed host has no read access to the path specified.
The new code will work correctly in that situation.
Both versions fail if the user can't traverse the parent directory.

I've also added a check to the try block to catch OSError. I've seen
this call fail with an OSError on rare occasion in the face of odd
extended permissions (usually MAC configuration) in cases where it
should technically return False. In such cases, the file is functionally
inaccessible to the user making the call, so it's essentially not there,
but it can't be created by them either. I've documented this, as well as
the fact that the bug this change fixes exists, and a rather nasty
inconsistency involving symbloic handling that I stumbled across while
testing this change.

Fixes: #20870
2017-12-13 11:10:19 -06:00
..
cli Only expose rekey options to ansible-vault command 2017-12-07 11:48:20 -05:00
compat Create a short license for PSF and MIT. (#32212) 2017-11-06 10:25:30 -08:00
config Add Support for Mellanox switches: first module: mlnxos_command (#33121) 2017-11-27 20:55:08 +00:00
errors Remove uses of assert in production code (#32079) 2017-11-13 11:51:18 -05:00
executor always preserve certain keys (#33637) 2017-12-12 13:01:52 -05:00
galaxy Fix a typo in the readme of the skeleton used by ansible-galaxy. (#33807) 2017-12-13 11:35:05 +01:00
inventory locahost -> localhost typo in inventory/data.py (#33790) 2017-12-12 09:46:18 +01:00
module_utils influxdb: fix missing arg specs (#33859) 2017-12-13 12:41:57 +01:00
modules wait_for: change file check to handle directories and sockets (#20979) 2017-12-13 11:10:19 -06:00
parsing Remove uses of assert in production code (#32079) 2017-11-13 11:51:18 -05:00
playbook normalize names 2017-12-11 18:20:04 -05:00
plugins YAML inventory unit test: fix test inventory format (#33828) 2017-12-13 15:30:59 +00:00
template Deprecate tests used as filters (#32361) 2017-11-27 17:58:08 -05:00
utils influxdb: fix missing arg specs (#33859) 2017-12-13 12:41:57 +01:00
vars fix item var in delegation (#32986) 2017-11-20 09:29:55 -05:00
__init__.py
constants.py Fixes eos sending 'None' to device (#33015) 2017-11-17 11:33:54 -05:00
release.py Bump the versions now that devel is 2.5 2017-09-06 13:13:57 -07:00