From 1fa3dbb7d2348bf4c25c116dd808831ef31ae387 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Wed, 1 Apr 2015 12:12:34 -0400 Subject: [PATCH] capture IOErrors on backup_local (happens on non posix filesystems) fixes #10591 --- lib/ansible/module_utils/basic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/module_utils/basic.py b/lib/ansible/module_utils/basic.py index ad1d43f86c..aaaf85e5e0 100644 --- a/lib/ansible/module_utils/basic.py +++ b/lib/ansible/module_utils/basic.py @@ -1303,7 +1303,7 @@ class AnsibleModule(object): try: shutil.copy2(fn, backupdest) - except shutil.Error, e: + except (shutil.Error, IOError), e: self.fail_json(msg='Could not make backup of %s to %s: %s' % (fn, backupdest, e)) return backupdest