aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2016-11-23 15:00:00 +1300
committerPaul Eggleton <paul.eggleton@linux.intel.com>2016-12-22 16:12:51 +1300
commit181f25ab570147931954417e03c4aaaf0d93ed7b (patch)
tree1fe34c8a1e2f12079ed3723a452d0146cf406ce6
parentf34844865a81dce83014721eff986f9fb27d6afd (diff)
downloadopenembedded-core-contrib-181f25ab570147931954417e03c4aaaf0d93ed7b.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. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
-rwxr-xr-xscripts/oe-selftest3
1 files changed, 2 insertions, 1 deletions
diff --git a/scripts/oe-selftest b/scripts/oe-selftest
index bfcea66f1c..1f11a06089 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")