Openembedded Bitbake Development
 help / color / mirror / Atom feed
From: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
To: Robert Yang <liezhi.yang@windriver.com>,
	"bitbake-devel@lists.openembedded.org"
	<bitbake-devel@lists.openembedded.org>
Cc: "quaresma.jose@gmail.com" <quaresma.jose@gmail.com>
Subject: RE: [bitbake-devel] [PATCH 1/1] bitbake-worker: Check BB_TASK_NETWORK before disable network for task
Date: Thu, 20 Jan 2022 13:50:21 +0000	[thread overview]
Message-ID: <db841326fc6647919a2ee07a82693e30@axis.com> (raw)
In-Reply-To: <75af98ed9992aad08e6fadc64d1985a165529828.1642663574.git.liezhi.yang@windriver.com>

> -----Original Message-----
> From: bitbake-devel@lists.openembedded.org <bitbake-devel@lists.openembedded.org> On Behalf Of Robert Yang
> Sent: den 20 januari 2022 08:27
> To: bitbake-devel@lists.openembedded.org
> Cc: quaresma.jose@gmail.com
> Subject: [bitbake-devel] [PATCH 1/1] bitbake-worker: Check BB_TASK_NETWORK before disable network for task
> 
> The NIS user can't work when task's network is disabled, so check
> BB_TASK_NETWORK before disable it, the conf files can set BB_TASK_NETWORK.
> 
> Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
> ---
>  bitbake/bin/bitbake-worker | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/bitbake/bin/bitbake-worker b/bitbake/bin/bitbake-worker
> index 3aaf3c2444b..3d7a781d35c 100755
> --- a/bitbake/bin/bitbake-worker
> +++ b/bitbake/bin/bitbake-worker
> @@ -261,7 +261,8 @@ def fork_off_task(cfg, data, databuilder, workerdata,
> fn, task, taskname, taskha
> 
>                  bb.utils.set_process_name("%s:%s" % (the_data.getVar("PN"), taskname.replace("do_", "")))
> 
> -                if not the_data.getVarFlag(taskname, 'network', False):
> +                bb_task_network = bb.utils.to_boolean(the_data.getVar('BB_TASK_NETWORK'), False)

Why use False to getVar() above?

> +                if not (bb_task_network or the_data.getVarFlag(taskname, 'network', False)):

I can't speak for others, but I find "not (foo or bar)" a lot harder to 
parse than "not foo and not bar".

>                      logger.debug("Attempting to disable network")
>                      bb.utils.disable_network(uid, gid)
> 
> --
> 2.31.1

//Peter



  reply	other threads:[~2022-01-20 13:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-20  7:27 [PATCH 0/1] bitbake-worker: Check BB_TASK_NETWORK before disable network for task Robert Yang
2022-01-20  7:27 ` [PATCH 1/1] " Robert Yang
2022-01-20 13:50   ` Peter Kjellerstedt [this message]
2022-01-21  3:15     ` [bitbake-devel] " Robert Yang
2022-01-21 15:36       ` Peter Kjellerstedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=db841326fc6647919a2ee07a82693e30@axis.com \
    --to=peter.kjellerstedt@axis.com \
    --cc=bitbake-devel@lists.openembedded.org \
    --cc=liezhi.yang@windriver.com \
    --cc=quaresma.jose@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox