mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
now also captrure OSErrors on temp file fixes #360
This commit is contained in:
@@ -137,11 +137,11 @@ def enforce_state(module, params):
|
|||||||
outf.write(key)
|
outf.write(key)
|
||||||
outf.close()
|
outf.close()
|
||||||
module.atomic_move(outf.name,path)
|
module.atomic_move(outf.name,path)
|
||||||
except IOError,e:
|
except (IOError,OSError),e:
|
||||||
module.fail_json(msg="Failed to write to file %s: %s" % \
|
module.fail_json(msg="Failed to write to file %s: %s" % \
|
||||||
(path,str(e)))
|
(path,str(e)))
|
||||||
params['changed'] = True
|
params['changed'] = True
|
||||||
|
|
||||||
return params
|
return params
|
||||||
|
|
||||||
def sanity_check(module,host,key,sshkeygen):
|
def sanity_check(module,host,key,sshkeygen):
|
||||||
|
|||||||
Reference in New Issue
Block a user