[bitbake-devel,2/2,v2] fetch2: Use bb.utils.to_boolean() for BB_NO_NETWORK

Submitted by Robert Yang on March 25, 2019, 8:10 a.m. | Patch ID: 159768

Details

Message ID 1a8af9bf38bd4401ca71c076d14e5f74e589f888.1553501143.git.liezhi.yang@windriver.com
State New
Headers show

Commit Message

Robert Yang March 25, 2019, 8:10 a.m.
Make it consistent with BB_FETCH_PREMIRRORONLY.

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
 bitbake/lib/bb/fetch2/__init__.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py
index 6445184..8fecc80 100644
--- a/bitbake/lib/bb/fetch2/__init__.py
+++ b/bitbake/lib/bb/fetch2/__init__.py
@@ -898,7 +898,7 @@  def check_network_access(d, info, url):
     log remote network access, and error if BB_NO_NETWORK is set or the given
     URI is untrusted
     """
-    if d.getVar("BB_NO_NETWORK") == "1":
+    if bb.utils.to_boolean(d.getVar("BB_NO_NETWORK")):
         raise NetworkAccess(url, info)
     elif not trusted_network(d, url):
         raise UntrustedUrl(url, info)
@@ -1098,7 +1098,7 @@  def trusted_network(d, url):
     BB_ALLOWED_NETWORKS is set globally or for a specific recipe.
     Note: modifies SRC_URI & mirrors.
     """
-    if d.getVar('BB_NO_NETWORK') == "1":
+    if bb.utils.to_boolean(d.getVar("BB_NO_NETWORK")):
         return True
 
     pkgname = d.expand(d.getVar('PN', False))