diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2012-09-07 16:22:53 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-09-10 13:14:08 +0100 |
commit | 4d8ba9a0ec0afc2d14042ac0e153827b65a7428d (patch) | |
tree | aae912ee92b0ddbc7ba4921c30b0ea7be012e67b /bitbake/lib/bb/fetch2 | |
parent | e843d56a31956e6e61ad2b07618bf3058978f164 (diff) | |
download | poky-4d8ba9a0ec0afc2d14042ac0e153827b65a7428d.tar.gz |
bitbake: fetch2: fix malformed URL causing a useless traceback
The implementation of NoMethodError and MalformedUrl was broken - if you
just set self.args in an exception class to a string it treats it as a
list and then fails later on with a TypeError due to the number of
arguments not matching up.
This nasty exception during exception handling was breaking the normal
exception flow (fixed separately), which meant that if you had a
malformed URL or invalid protocol in SRC_URI you would get the
following:
ERROR: Command execution failed: Traceback (most recent call last):
File "/home/user/poky/poky/bitbake/lib/bb/command.py", line 84, in runAsyncCommand
self.cooker.updateCache()
File "/home/user/poky/poky/bitbake/lib/bb/cooker.py", line 1207, in updateCache
if not self.parser.parse_next():
File "/home/user/poky/poky/bitbake/lib/bb/cooker.py", line 1694, in parse_next
logger.error('Unable to parse %s', value.recipe,
AttributeError: 'exceptions.TypeError' object has no attribute 'recipe'
A specific fix for [YOCTO #2977].
(Bitbake rev: 9d4150d99051d24ff218e8a43664ceaf524b19c7)
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/fetch2')
-rw-r--r-- | bitbake/lib/bb/fetch2/__init__.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py index fae1addf77..37f7d7544e 100644 --- a/bitbake/lib/bb/fetch2/__init__.py +++ b/bitbake/lib/bb/fetch2/__init__.py | |||
@@ -54,7 +54,7 @@ class MalformedUrl(BBFetchException): | |||
54 | msg = "The URL: '%s' is invalid and cannot be interpreted" % url | 54 | msg = "The URL: '%s' is invalid and cannot be interpreted" % url |
55 | self.url = url | 55 | self.url = url |
56 | BBFetchException.__init__(self, msg) | 56 | BBFetchException.__init__(self, msg) |
57 | self.args = url | 57 | self.args = (url,) |
58 | 58 | ||
59 | class FetchError(BBFetchException): | 59 | class FetchError(BBFetchException): |
60 | """General fetcher exception when something happens incorrectly""" | 60 | """General fetcher exception when something happens incorrectly""" |
@@ -87,7 +87,7 @@ class NoMethodError(BBFetchException): | |||
87 | msg = "Could not find a fetcher which supports the URL: '%s'" % url | 87 | msg = "Could not find a fetcher which supports the URL: '%s'" % url |
88 | self.url = url | 88 | self.url = url |
89 | BBFetchException.__init__(self, msg) | 89 | BBFetchException.__init__(self, msg) |
90 | self.args = url | 90 | self.args = (url,) |
91 | 91 | ||
92 | class MissingParameterError(BBFetchException): | 92 | class MissingParameterError(BBFetchException): |
93 | """Exception raised when a fetch method is missing a critical parameter in the url""" | 93 | """Exception raised when a fetch method is missing a critical parameter in the url""" |