]> code.ossystems Code Review - openembedded-core.git/commitdiff
lib/oeqa/decorators: handle broken links when creating new symlink
authorRoss Burton <ross.burton@intel.com>
Fri, 22 Jul 2016 14:03:30 +0000 (15:03 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 25 Jul 2016 22:46:55 +0000 (23:46 +0100)
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@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/utils/decorators.py

index 0b23565485a4e46f76896ad2d57f53ef04a3db5b..615fd956b561535cd6d7fc772732c13b710e6f62 100644 (file)
@@ -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)