ansible/ansible — pull request #3379 by serenecloud (2013-06-30 03:43:46+00:00)
Title: Return a friendly error message if aptitude isn't installed

Fix for Issue#3101 - changes the error:

fatal: [husker.crimson.net.nz] => failed to parse: Traceback (most recent call last):
File "/home/ansible/.ansible/tmp/ansible-1370213747.54-271802212190720/apt", line 1238, in
main()
File "/home/ansible/.ansible/tmp/ansible-1370213747.54-271802212190720/apt", line 318, in main
upgrade(module, p['upgrade'])
File "/home/ansible/.ansible/tmp/ansible-1370213747.54-271802212190720/apt", line 232, in upgrade
apt_cmd_path = m.get_bin_path(apt_cmd, required=True)
File "/home/ansible/.ansible/tmp/ansible-1370213747.54-271802212190720/apt", line 1049, in get_bin_path
path = os.path.join(d, arg)
File "/usr/lib/python2.7/posixpath.py", line 75, in join
if b.startswith('/'):
AttributeError: 'NoneType' object has no attribute 'startswith'

to

failed: [starbuck.crimson.net.nz] => {"failed": true}
msg: Could not find aptitude. Please ensure it is installed.