Traceback with the setup module on SLES 10 SP2 host

Hi,

It seems that since ansible 1.1, the setup module failed on old SLES 10 SP2 host.

I have the following traceback:

fatal: [myhost] => failed to parse:
Traceback (most recent call last):
File “/home/user/.ansible/tmp/ansible-1368456661.8-263287084724264/setup”, line 2587, in ?
main()
File “/home/user/.ansible/tmp/ansible-1368456661.8-263287084724264/setup”, line 1689, in main
data = run_setup(module)
File “/home/user/.ansible/tmp/ansible-1368456661.8-263287084724264/setup”, line 1634, in run_setup
facts = ansible_facts()
File “/home/user/.ansible/tmp/ansible-1368456661.8-263287084724264/setup”, line 1624, in ansible_facts
facts.update(Hardware().populate())
File “/home/user/.ansible/tmp/ansible-1368456661.8-263287084724264/setup”, line 408, in populate
self.get_device_facts()
File “/home/user/.ansible/tmp/ansible-1368456661.8-263287084724264/setup”, line 629, in get_device_facts
for folder in os.listdir(sysdir + “/holders”):
OSError: [Errno 2] No such file or directory: ‘/sys/block/sdb/holders’

I tried debugging with the test-module but it fails with

$ test-module -m …/library/system/setup
Traceback (most recent call last):
File “./test-module”, line 36, in ?
import ansible.utils as utils
File “/home/user/ansible/lib/ansible/utils/init.py”, line 695
with warnings.catch_warnings():

^
SyntaxError: invalid syntax

I also tested with the latest checkout and I have the same error…

Thanks for any help on this.

You need Python 2.6 in order to use the ./test-module script because it’s using Python 2.6 code in utils. That is expected.

Looks like we just need to modify the setup module to allow for that path to not exist, which is easy enough.

You need Python 2.6 in order to use the ./test-module script because it’s using Python 2.6 code in utils. That is expected.

I thought so…

Looks like we just need to modify the setup module to allow for that path to not exist, which is easy enough.

Should I file an issue ?

yes, please!