I followed the docs example to add a module as with the time.py example. 
 
So I have: 
-----------
#!/usr/bin/python

import datetime
import json

date = str(datetime.datetime.now())
print json.dumps({
    "time" : date
})
-----------
 
And after:
 
source ansible/hacking/env-setup
chmod +x ansible/hacking/test-module
ansible/hacking/test-module -m ./time.py
 
I get: 
 

{"time": "2014-10-30 14:34:22.224548"}

Traceback (most recent call last):

File "ansible-dev/hacking/test-module", line 37, in <module>

import ansible.utils as utils

File 
"/export/home/jsuriol/.local/lib/python2.6/site-packages/ansible-1.8-py2.6.egg/ansible/utils/__init__.py",
 
line 29, in <module>

from ansible.utils.display_functions import *

File 
"/export/home/jsuriol/.local/lib/python2.6/site-packages/ansible-1.8-py2.6.egg/ansible/utils/display_functions.py",
 
line 22, in <module>

from ansible.callbacks import display

File 
"/export/home/jsuriol/.local/lib/python2.6/site-packages/ansible-1.8-py2.6.egg/ansible/callbacks.py",
 
line 31, in <module>

import logging

File "/usr/lib/python2.6/logging/__init__.py", line 89, in <module>

_startTime = time.time()

AttributeError: 'module' object has no attribute 'time'

-------

The file logging/__init__.py imports time, so what can the problem be? 

 

Thanks

 

 

 

-- 
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/78ba5eaa-226c-412c-8df9-559014c722e0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to