[OE-core] [PATCH] lib/oeqa/decorators: handle broken links when creating new symlink

Ross Burton ross.burton at intel.com
Fri Jul 22 14:03:30 UTC 2016


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 <ross.burton at intel.com>
---
 meta/lib/oeqa/utils/decorators.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/lib/oeqa/utils/decorators.py b/meta/lib/oeqa/utils/decorators.py
index 0b23565..615fd95 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)
 
-- 
2.8.1




More information about the Openembedded-core mailing list