summaryrefslogtreecommitdiffstats
path: root/scripts/oe-selftest
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2016-12-22 16:13:57 +1300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-01-09 13:39:11 +0000
commit0f315faff8d9e76b25e27e5cf935c7ef203e8b65 (patch)
tree5cda7b6a4705ee79b359baea5909588e5faef286 /scripts/oe-selftest
parent3f990e1b178dc7230e2e3d60ffd3dcc5d9eae16b (diff)
downloadpoky-0f315faff8d9e76b25e27e5cf935c7ef203e8b65.tar.gz
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 <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/oe-selftest')
-rwxr-xr-xscripts/oe-selftest3
1 files changed, 2 insertions, 1 deletions
diff --git a/scripts/oe-selftest b/scripts/oe-selftest
index e166521238..adfa92f707 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")
62 62
63def logger_create(): 63def logger_create():
64 log_file = log_prefix + ".log" 64 log_file = log_prefix + ".log"
65 if os.path.exists("oe-selftest.log"): os.remove("oe-selftest.log") 65 if os.path.lexists("oe-selftest.log"):
66 os.remove("oe-selftest.log")
66 os.symlink(log_file, "oe-selftest.log") 67 os.symlink(log_file, "oe-selftest.log")
67 68
68 log = logging.getLogger("selftest") 69 log = logging.getLogger("selftest")