solj/bcfg2 — pull request #100 by mikemccllstr (2011-10-16 04:55:15+00:00)
Title: Improve error handling of Packages plugin.

Replaced all print statements in Packages with logger calls.

Made log messages for Packages plugin use a consistent "Packages:"
prefix.

Provided a descriptive error message that avoids logging a traceback
in Source.py.

Changed to error out (instead of continuing) upon receiving an HTTP
error or an indication that the URL is malformed.

Changed to only write data to the cache file if it was successfully
retrieved from the URL.

In Bcfg2Py3k.py, use urlopen() from urllib2 instead of urllib so that
HTTP errors will be caught. When using urllib.urlopen(), no exception
is thrown when the URL request receives a 403 error, for example. In
particular, this impacts the Packages plugin, since it uses the
urlopen() method and was failing to detect or report the problem to
the user.