From: Ross Burton Date: Fri, 22 Jul 2016 14:03:30 +0000 (+0100) Subject: lib/oeqa/decorators: handle broken links when creating new symlink X-Git-Tag: uninative-1.3~227 X-Git-Url: https://code.ossystems.io/gitweb?a=commitdiff_plain;h=ec24b6de2b8686e1f779fef3a963e66f70eeba74;p=openembedded-core.git lib/oeqa/decorators: handle broken links when creating new symlink When checking if a link exists before creating it, use os.path.lexists() as otherwise os.path.exists() on a broken link will return False. Signed-off-by: Ross Burton Signed-off-by: Richard Purdie --- diff --git a/meta/lib/oeqa/utils/decorators.py b/meta/lib/oeqa/utils/decorators.py index 0b23565485..615fd956b5 100644 --- a/meta/lib/oeqa/utils/decorators.py +++ b/meta/lib/oeqa/utils/decorators.py @@ -190,7 +190,7 @@ def LogResults(original_class): local_log.results("Testcase "+str(test_case)+": PASSED") # Create symlink to the current log - if os.path.exists(linkfile): + if os.path.lexists(linkfile): os.remove(linkfile) os.symlink(logfile, linkfile)