Community Packages

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#41482 - [ansible] Python errors with ansible-doc -l

Attached to Project: Community Packages
Opened by Phillip Smith (fukawi2) - Wednesday, 06 August 2014, 03:25 GMT
Last edited by Bartłomiej Piotrowski (Barthalion) - Friday, 12 September 2014, 11:13 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Bartłomiej Piotrowski (Barthalion)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

When running ansible-doc -l, I get a bunch of python errors (below).

Removing /usr/share/ansible/examples/ansible.cfg and /usr/share/ansible/examples/hosts stops this -- not sure that is a correct/valid solution though.

$ pacman -Q ansible
ansible 1.6.6-1



$ ansible-doc -l
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/ansible/utils/module_docs.py", line 50, in get_docstring
M = ast.parse(''.join(open(filename)))
File "/usr/lib/python2.7/ast.py", line 37, in parse
return compile(source, filename, mode, PyCF_ONLY_AST)
File "<unknown>", line 14
hostfile = /etc/ansible/hosts
^
SyntaxError: invalid syntax
Traceback (most recent call last):
File "/usr/sbin/ansible-doc", line 179, in get_module_list_text
desc = tty_ify(doc.get('short_description', '?'))
AttributeError: 'NoneType' object has no attribute 'get'
ERROR: module ansible.cfg has a documentation error formatting or is missing documentation
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/ansible/utils/module_docs.py", line 50, in get_docstring
M = ast.parse(''.join(open(filename)))
File "/usr/lib/python2.7/ast.py", line 37, in parse
return compile(source, filename, mode, PyCF_ONLY_AST)
File "<unknown>", line 15
192.168.100.1
^
SyntaxError: invalid syntax
Traceback (most recent call last):
File "/usr/sbin/ansible-doc", line 179, in get_module_list_text
desc = tty_ify(doc.get('short_description', '?'))
AttributeError: 'NoneType' object has no attribute 'get'
ERROR: module hosts has a documentation error formatting or is missing documentation
This task depends upon

Closed by  Bartłomiej Piotrowski (Barthalion)
Friday, 12 September 2014, 11:13 GMT
Reason for closing:  Fixed
Additional comments about closing:  ansible 1.7.1-3
Comment by Doug Newgard (Scimmia) - Wednesday, 06 August 2014, 14:29 GMT Comment by Phillip Smith (fukawi2) - Thursday, 07 August 2014, 03:42 GMT
No I do not. That issue seems to be with running modules on remote hosts. This issue occurs on the local machine.

I tried `export ansible_python_interpreter=/usr/bin/python2` anyway, but the same result.
Comment by Johann Klähn (joni) - Thursday, 11 September 2014, 13:44 GMT
I think this issue is caused by copying the examples folder into /usr/share/ansible. As the library/* folders of the original package are copied there, too, ansible expects plain files in first-order-subdirectories of /usr/share/ansible to be modules. This is true for everything copied from libraries/*, but the files in examples/ aren't well formed python files and thus cause errors.
Maybe installing the examples folder in /usr/share/doc/ansible would be somewhat more sensible?

Loading...