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>
This commit is contained in:
parent
3abc2cc968
commit
dd2ea8ae1d
1 changed files with 1 additions and 1 deletions
|
@ -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…
Reference in a new issue