aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2018-10-17 10:54:40 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-10-17 12:24:29 +0100
commita68de8ace62eaba23856bfb301efbbe1824322aa (patch)
treef72d32083b5db88e0cee45223167e2e43e5281db
parent3f4968c77129252e8d0833fbd683372fca243a90 (diff)
downloadbitbake-a68de8ace62eaba23856bfb301efbbe1824322aa.tar.gz
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>
-rw-r--r--lib/bb/fetch2/__init__.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/bb/fetch2/__init__.py b/lib/bb/fetch2/__init__.py
index 9aea08b38..2b62b4161 100644
--- a/lib/bb/fetch2/__init__.py
+++ b/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')