[elbe-devel] [PATCH v2 06/24] pkgutils: raise an exception if pkg not found

Manuel Traut manut at linutronix.de
Thu Feb 8 14:16:52 CET 2018


avoid iterating over NoneType exception by checking urilist variable
before iterating over it.

Signed-off-by: Manuel Traut <manut at linutronix.de>
Reviewed-by: Torben Hohn <torben.hohn at linutronix.de>
---
 elbepack/pkgutils.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/elbepack/pkgutils.py b/elbepack/pkgutils.py
index 55f80f94..70a27971 100644
--- a/elbepack/pkgutils.py
+++ b/elbepack/pkgutils.py
@@ -238,6 +238,9 @@ def download_pkg(prj,
     except CommandError as e:
         raise NoKinitrdException("couldn't download package %s" % package)
 
+    if not urilist:
+        raise NoKinitrdException("couldn't download package %s" % package)
+
     for u in urilist:
         sha256 = u[2]
         uri = u[1]
-- 
2.15.1




More information about the elbe-devel mailing list