ansible/ansible — pull request #7735 by toddmowen (2014-06-12 07:16:58+00:00)
Title: pkgutil: exception when 'site' parameter is missing

The first of these commits fixes a bug in the pkgutil module. Although the 'site' parameter is intended to be optional, omitting it would cause the following exception if the requested package was already installed:

invalid output was: Traceback (most recent call last):
File "/tmp/ansible-tmp-1402553652.18-229268856436124/pkgutil", line 1398, in
main()
File "/tmp/ansible-tmp-1402553652.18-229268856436124/pkgutil", line 153, in main
if not package_latest(module, name, site):
File "/tmp/ansible-tmp-1402553652.18-229268856436124/pkgutil", line 78, in package_latest
site = pipes.quote(site)
File "/usr/lib/python2.6/pipes.py", line 271, in quote
for c in file:
TypeError: 'NoneType' object is not iterable

The fix was simply not to call `pipes.quote(site)` until after checking whether the argument is Null.

The other two commits in this PR are general cleanup in the pkgutil module, including removal of use_unsafe_shell.