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

925 views
Skip to first unread message

Francisco Reyes

unread,
Apr 19, 2014, 6:03:02 PM4/19/14
to ansible...@googlegroups.com
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] => failed to parse: Traceback (most recent call last):
  File "/root/.ansible/tmp/ansible-tmp-1397944758.52-275089191503778/setup", line 1391, in <module>
    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.

Francisco Reyes

unread,
Apr 19, 2014, 6:08:03 PM4/19/14
to ansible...@googlegroups.com
On Saturday, April 19, 2014 6:03:02 PM UTC-4, Francisco Reyes wrote:
>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] => 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.

Brian Coca

unread,
Apr 19, 2014, 9:41:55 PM4/19/14
to ansible...@googlegroups.com
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)


Brian Coca

unread,
Apr 19, 2014, 9:45:38 PM4/19/14
to ansible...@googlegroups.com

Francisco Reyes

unread,
Apr 19, 2014, 11:19:12 PM4/19/14
to ansible...@googlegroups.com
On Saturday, April 19, 2014 9:45:38 PM UTC-4, Brian Coca wrote:
>https://github.com/ansible/ansible/pull/7081

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

Michael DeHaan

unread,
Apr 21, 2014, 9:15:40 AM4/21/14
to ansible...@googlegroups.com
Merged, thanks!

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






--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/d76bbfb5-3b3c-4132-8ac9-1626b4beaf7a%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages