From: Paul Eggleton Date: Thu, 22 Dec 2016 03:13:57 +0000 (+1300) Subject: oe-selftest: fix behaviour if oe-selftest.log is a dangling symlink X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0f315faff8d9e76b25e27e5cf935c7ef203e8b65;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git oe-selftest: fix behaviour if oe-selftest.log is a dangling symlink If you delete the log file that the oe-selftest.log symlink points to but not the symlink itself, because we were using os.path.exists() here the code assumed that the symlink didn't exist when in fact it still did. Use os.path.lexists() instead. (From OE-Core rev: 263af91a0efd21e041ecdb0c40f9b2d4e735f67d) Signed-off-by: Paul Eggleton Signed-off-by: Ross Burton Signed-off-by: Richard Purdie --- diff --git a/scripts/oe-selftest b/scripts/oe-selftest index e1665212386..adfa92f7075 100755 --- a/scripts/oe-selftest +++ b/scripts/oe-selftest @@ -62,7 +62,8 @@ log_prefix = "oe-selftest-" + t.strftime("%Y%m%d-%H%M%S") def logger_create(): log_file = log_prefix + ".log" - if os.path.exists("oe-selftest.log"): os.remove("oe-selftest.log") + if os.path.lexists("oe-selftest.log"): + os.remove("oe-selftest.log") os.symlink(log_file, "oe-selftest.log") log = logging.getLogger("selftest")