public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Alexander Smirnov <asmirnov@ilbers.de>
To: Jan Kiszka <jan.kiszka@siemens.com>,
	isar-users <isar-users@googlegroups.com>
Subject: Re: [PATCH] Skip over event handler calls with incomplete environment
Date: Wed, 7 Feb 2018 19:12:28 +0300	[thread overview]
Message-ID: <e57b73c0-bf3e-0f58-9971-04c9501327ed@ilbers.de> (raw)
In-Reply-To: <b0dd3040-3f8a-740c-c2de-2b55fdd90cfc@siemens.com>

On 02/07/2018 06:59 PM, Jan Kiszka wrote:
> From: Jan Kiszka <jan.kiszka@siemens.com>
> 
> The cleanup handler is called a couple of times per shutdown and,
> depending on the setup, some may not have a complete config. Avoid that
> we stumble and fall over any of the environment variables being
> undefined.
> 
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>

Should I apply me previous one?

Alex

> ---
>   meta/classes/isar-events.bbclass | 17 +++++++++--------
>   1 file changed, 9 insertions(+), 8 deletions(-)
> 
> diff --git a/meta/classes/isar-events.bbclass b/meta/classes/isar-events.bbclass
> index ae0f791..4b5e97e 100644
> --- a/meta/classes/isar-events.bbclass
> +++ b/meta/classes/isar-events.bbclass
> @@ -15,15 +15,16 @@ python isar_handler () {
>           distro = d.getVar('DISTRO', True)
>           arch = d.getVar('DISTRO_ARCH', True)
>   
> -        w = tmpdir + '/work/' + distro + '-' + arch
> +        if tmpdir and distro and arch:
> +            w = tmpdir + '/work/' + distro + '-' + arch
>   
> -        # '/proc/mounts' contains all the active mounts, so knowing 'w' we
> -        # could get the list of mounts for the specific multiconfig and
> -        # clean them.
> -        with open('/proc/mounts', 'rU') as f:
> -            for line in f:
> -                if w in line:
> -                    subprocess.call('sudo umount -f ' + line.split()[1], stdout=devnull, stderr=devnull, shell=True)
> +            # '/proc/mounts' contains all the active mounts, so knowing 'w' we
> +            # could get the list of mounts for the specific multiconfig and
> +            # clean them.
> +            with open('/proc/mounts', 'rU') as f:
> +                for line in f:
> +                    if w in line:
> +                        subprocess.call('sudo umount -f ' + line.split()[1], stdout=devnull, stderr=devnull, shell=True)
>   
>       devnull.close()
>   }
> 

  reply	other threads:[~2018-02-07 16:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-07 15:59 Jan Kiszka
2018-02-07 16:12 ` Alexander Smirnov [this message]
2018-02-08  7:27   ` Jan Kiszka

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=e57b73c0-bf3e-0f58-9971-04c9501327ed@ilbers.de \
    --to=asmirnov@ilbers.de \
    --cc=isar-users@googlegroups.com \
    --cc=jan.kiszka@siemens.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