Skip to contentSkip to conversation

fetch2: fix checkstatus fallback to MIRRORS

PATCH New Ross Burton 1 participant 1 message Jul 28, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fetch2: fix checkstatus fallback to MIRRORS

The checkstatus() code was expecting checkstatus to throw exceptions if it failed, but in general it should return False.

---
 bitbake/lib/bb/fetch2/__init__.py | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
bitbake/lib/bb/fetch2/__init__.py +2 -3
index bd23533ebc0..7afb2aeb734 100644
@@ -1726,9 +1726,8 @@ class Fetch(object):
             ret = try_mirrors(self, self.d, ud, mirrors, True)
             if not ret:
                 # Next try checking from the original uri, u
-                try:
-                    ret = m.checkstatus(self, ud, self.d)
-                except:
+                ret = m.checkstatus(self, ud, self.d)
+                if not ret:
                     # Finally, try checking uri, u, from MIRRORS
                     mirrors = mirror_from_string(self.d.getVar('MIRRORS'))
                     ret = try_mirrors(self, self.d, ud, mirrors, True)
Signature · 1 line
2.11.0