From: Jan Kiszka <jan.kiszka@web.de>
To: isar-users <isar-users@googlegroups.com>
Subject: [PATCH] isar-events: Fix processing of /proc/mounts
Date: Sun, 9 Dec 2018 17:06:19 +0100 [thread overview]
Message-ID: <dda77f5a-c50a-2dd0-41f4-864f0bbee1d1@web.de> (raw)
From: Jan Kiszka <jan.kiszka@siemens.com>
We have to read /proc/mounts completely before starting to umount. That
virtual file will change after each umount, and that could make us miss
some mount points.
Fixes: 05d0fc43e9e9 ("isar-events: Improve umount handler")
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
meta/classes/isar-events.bbclass | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/meta/classes/isar-events.bbclass b/meta/classes/isar-events.bbclass
index 05b27e5..c4a6149 100644
--- a/meta/classes/isar-events.bbclass
+++ b/meta/classes/isar-events.bbclass
@@ -18,10 +18,11 @@ python isar_handler() {
with open(os.devnull, 'w') as devnull:
with open('/proc/mounts', 'rU') as f:
- for line in f:
- if basepath in line:
- subprocess.call('sudo umount -l ' + line.split()[1],
- stdout=devnull, stderr=devnull, shell=True)
+ lines = f.readlines()
+ for line in lines:
+ if basepath in line:
+ subprocess.call('sudo umount -l ' + line.split()[1],
+ stdout=devnull, stderr=devnull, shell=True)
}
isar_handler[eventmask] = "bb.runqueue.runQueueExitWait bb.event.BuildCompleted"
--
2.16.4
next reply other threads:[~2018-12-09 16:06 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-09 16:06 Jan Kiszka [this message]
2018-12-11 8:12 ` Maxim Yu. Osipov
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=dda77f5a-c50a-2dd0-41f4-864f0bbee1d1@web.de \
--to=jan.kiszka@web.de \
--cc=isar-users@googlegroups.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