From 89284bcce012931340ee5212049f92795c90718f Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Wed, 1 Apr 2015 20:44:28 -0400 Subject: [PATCH] now also captrure OSErrors on temp file fixes #360 --- system/known_hosts.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system/known_hosts.py b/system/known_hosts.py index c2030758cc8..b332528ed19 100644 --- a/system/known_hosts.py +++ b/system/known_hosts.py @@ -137,11 +137,11 @@ def enforce_state(module, params): outf.write(key) outf.close() module.atomic_move(outf.name,path) - except IOError,e: + except (IOError,OSError),e: module.fail_json(msg="Failed to write to file %s: %s" % \ (path,str(e))) params['changed'] = True - + return params def sanity_check(module,host,key,sshkeygen):