From dd4ac463974403c7fe96267f4c09bbc841ecb1e7 Mon Sep 17 00:00:00 2001 From: Dag Wieers Date: Tue, 4 Dec 2012 19:27:22 +0100 Subject: [PATCH] Import errno to avoid 'NameError: global name 'errno' is not defined' I hit the following exception because errno is referenced but not imported. ``` fatal: [system01] => failed to parse: Traceback (most recent call last): File "/root/.ansible/tmp/ansible-1354644532.37-246102819320352/copy", line 782, in main() File "/root/.ansible/tmp/ansible-1354644532.37-246102819320352/copy", line 117, in main module.atomic_replace(dest_tmp, dest) File "/root/.ansible/tmp/ansible-1354644532.37-246102819320352/copy", line 772, in atomic_replace if e.errno != errno.EPERM: NameError: global name 'errno' is not defined ``` --- lib/ansible/module_common.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/ansible/module_common.py b/lib/ansible/module_common.py index 27d45aed44..e62932ad7c 100644 --- a/lib/ansible/module_common.py +++ b/lib/ansible/module_common.py @@ -56,6 +56,7 @@ import stat import grp import pwd import platform +import errno HAVE_SELINUX=False try: