[bitbake-devel,1/1] fetch2: Downgrade the fetch failure log to a warning

Submitted by Tyler Hall on Aug. 9, 2014, 10:46 p.m. | Patch ID: 77759


Message ID 1407624380-21750-2-git-send-email-tylerwhall@gmail.com
State New
Headers show

Commit Message

Tyler Hall Aug. 9, 2014, 10:46 p.m.
do_fetch and setscene are the two clients of Fetch.download(). For
setscene, a fetcher failure is non-fatal since the real task will run
instead. However if we we emit an error log, bitbake will return with a
nonzero exit status even if the overall build succeeded. Leave it up to
the client to decide whether the failure should be considered fatal.

The do_fetch task in openembedded-core handles the fetch error by
emitting an error log message of its own, so fatal fetch failures still
have an associated ERROR: message in the log.

The new output in this case is
WARNING: Fetcher failure: Unable to find file file:///invalid anywhere. The
paths that were searched were:
ERROR: Function failed: Fetcher failure for URL: 'file:///invalid'. Unable to
fetch URL from any source.
 lib/bb/fetch2/__init__.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/lib/bb/fetch2/__init__.py b/lib/bb/fetch2/__init__.py
index df2f2b0..f3b9463 100644
--- a/lib/bb/fetch2/__init__.py
+++ b/lib/bb/fetch2/__init__.py
@@ -1455,7 +1455,7 @@  class Fetch(object):
                 if not localpath or ((not os.path.exists(localpath)) and localpath.find("*") == -1):
                     if firsterr:
-                        logger.error(str(firsterr))
+                        logger.warn(str(firsterr))
                     raise FetchError("Unable to fetch URL from any source.", u)
                 update_stamp(ud, self.d)