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

Khem Raj raj.khem at gmail.com
Fri Jul 22 14:13:41 UTC 2016


On Fri, Jul 22, 2016 at 7:03 AM, Ross Burton <ross.burton at intel.com> wrote:
> 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):

I think it will fail if the existing file is not a symlink ?

>              os.remove(linkfile)
>          os.symlink(logfile, linkfile)
>
> --
> 2.8.1
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core at lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core



More information about the Openembedded-core mailing list