files/file.py: Raise an IOError when trying to touch a file with missing intermediate directories within it's path (#33765)

Fixes #33744

Signed-off-by: Patrick Ringl <patrick_@freenet.de>
pull/33806/head
pari- 7 years ago committed by Martin Krizek
parent 3abc2cc968
commit dd2ea8ae1d

@ -440,7 +440,7 @@ def main():
if prev_state == 'absent':
try:
open(b_path, 'wb').close()
except OSError as e:
except (OSError, IOError) as e:
module.fail_json(path=path, msg='Error, could not touch target: %s' % to_native(e, nonstring='simplerepr'))
elif prev_state in ('file', 'directory', 'hard'):
try:

Loading…
Cancel
Save