Переглянути джерело

fetch2: Avoid incorrect getVarFlag call

Calling getVarFlag with flag=None makes no sense, don't do it. Bitbake
used to silently ignore this, it now warns so avoid the warning.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Richard Purdie 5 роки тому
батько
коміт
a68de8ace6
1 змінених файлів з 3 додано та 1 видалено
  1. 3 1
      lib/bb/fetch2/__init__.py

+ 3 - 1
lib/bb/fetch2/__init__.py

@@ -1097,7 +1097,9 @@ def trusted_network(d, url):
         return True
 
     pkgname = d.expand(d.getVar('PN', False))
-    trusted_hosts = d.getVarFlag('BB_ALLOWED_NETWORKS', pkgname, False)
+    trusted_hosts = None
+    if pkgname:
+        trusted_hosts = d.getVarFlag('BB_ALLOWED_NETWORKS', pkgname, False)
 
     if not trusted_hosts:
         trusted_hosts = d.getVar('BB_ALLOWED_NETWORKS')