# AttributeError: 'module' object has no attribute 'ETIME' - after git update

**URL:** <https://forum.ansible.com/t/attributeerror-module-object-has-no-attribute-etime-after-git-update/15053>\
**Category:** Ansible Project\
**Tags:** ubuntu\
**Created:** [April 19, 2014, 10:03pm UTC](https://forum.ansible.com/t/attributeerror-module-object-has-no-attribute-etime-after-git-update/15053 "2014-04-19T22:03:02Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Francisco\_Reyes](https://avatars.discourse-cdn.com/v4/letter/f/b77776/32.png) [@Francisco\_Reyes](https://forum.ansible.com/u/Francisco_Reyes)\
**Post date:** [April 19, 2014, 10:03pm UTC](https://forum.ansible.com/t/attributeerror-module-object-has-no-attribute-etime-after-git-update/15053/1 "2014-04-19T22:03:02Z")

</div>

Had a working setup using the dev branch from a week or two ago… today I did an update and after that I am getting an error:

GATHERING FACTS \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
\<107.170.122.172\> REMOTE\_MODULE setup  
\<10.1.1.191\> REMOTE\_MODULE setup  
fatal: [[fat.natserv.net](http://fat.natserv.net)] =\> failed to parse: Traceback (most recent call last):  
File “/root/.ansible/tmp/ansible-tmp-1397944758.52-275089191503778/setup”, line 1391, in   
def timeout(seconds=10, error\_message=os.strerror(errno.ETIME)):  
AttributeError: ‘module’ object has no attribute ‘ETIME’

The error only happens going against a FreeBSD machine. No error against ubuntu.

The FreeBSD machine in question is a test machine so I don’t recall having done any updates to it.

Control machine: 10.0-RELEASE-p1  
Ansible in control machine: ansible 1.6 (devel ae29e43f93) last updated 2014/04/19 17:36:26 (GMT -400)

Node FreeBSD machine: Python 2.7.6

Any pointers greatly appreciated.

---

<div class="post-metadata">

**Author:** ![Francisco\_Reyes](https://avatars.discourse-cdn.com/v4/letter/f/b77776/32.png) [@Francisco\_Reyes](https://forum.ansible.com/u/Francisco_Reyes)\
**Post date:** [April 19, 2014, 10:08pm UTC](https://forum.ansible.com/t/attributeerror-module-object-has-no-attribute-etime-after-git-update/15053/2 "2014-04-19T22:08:03Z")

</div>

> Had a working setup using the dev branch from a week or two ago… today I did an update and after that I am getting an error:  
> …

> fatal: [[fat.natserv.net](http://fat.natserv.net/)] =\> failed to parse: Traceback (most recent call last):

I have another playbook which disables gathering facts  
gather\_facts: False

That playbook works without issues. So the problem is gathering facts in FreeBSD.

---

<div class="post-metadata">

**Author:** ![Brian\_Coca1](https://avatars.discourse-cdn.com/v4/letter/b/278dde/32.png) [@Brian\_Coca1](https://forum.ansible.com/u/Brian_Coca1)\
**Post date:** [April 20, 2014, 1:41am UTC](https://forum.ansible.com/t/attributeerror-module-object-has-no-attribute-etime-after-git-update/15053/3 "2014-04-20T01:41:55Z")

</div>

This actually affects also FreeBSD 8 and 9, the issue is that python errno module does not have ETIME constant on FreeBSD, this constant is used by the new timer module. The patch below fixes this in my tests, PR incoming.

diff --git a/lib/ansible/module\_utils/facts.py b/lib/ansible/module\_utils/facts.py  
index c056404…4c3e5ad 100644  
— a/lib/ansible/module\_utils/facts.py  
+++ b/lib/ansible/module\_utils/facts.py  
@@ -49,7 +49,7 @@ except ImportError:  
class TimeoutError(Exception):  
pass

-def timeout(seconds=10, error\_message=os.strerror(errno.ETIME)):  
+def timeout(seconds=10, error\_message=“Timer expired”):  
def decorator(func):  
def \_handle\_timeout(signum, frame):  
raise TimeoutError(error\_message)

---

<div class="post-metadata">

**Author:** ![Brian\_Coca1](https://avatars.discourse-cdn.com/v4/letter/b/278dde/32.png) [@Brian\_Coca1](https://forum.ansible.com/u/Brian_Coca1)\
**Post date:** [April 20, 2014, 1:45am UTC](https://forum.ansible.com/t/attributeerror-module-object-has-no-attribute-etime-after-git-update/15053/4 "2014-04-20T01:45:38Z")

</div>

[https://github.com/ansible/ansible/pull/7081](https://github.com/ansible/ansible/pull/7081)

---

<div class="post-metadata">

**Author:** ![Francisco\_Reyes](https://avatars.discourse-cdn.com/v4/letter/f/b77776/32.png) [@Francisco\_Reyes](https://forum.ansible.com/u/Francisco_Reyes)\
**Post date:** [April 20, 2014, 3:19am UTC](https://forum.ansible.com/t/attributeerror-module-object-has-no-attribute-etime-after-git-update/15053/5 "2014-04-20T03:19:12Z")

</div>

Thanks.  
That worked nicely. Patched my local copy until the repo has the fix.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [April 21, 2014, 1:15pm UTC](https://forum.ansible.com/t/attributeerror-module-object-has-no-attribute-etime-after-git-update/15053/6 "2014-04-21T13:15:40Z")

</div>

Merged, thanks!

We should not be putting functional calls in default assignments either so glad to see that cleaned up 🙂
