diff --git a/avocado/core/data_dir.py b/avocado/core/data_dir.py index 102700e199693d591e9fad868dd5ea555c307e03..7c018eaf019d105702047e5e5635a519ddd372e0 100755 --- a/avocado/core/data_dir.py +++ b/avocado/core/data_dir.py @@ -232,6 +232,8 @@ def update_latest_job_logs_dir(job_result_dir): basedir = os.path.dirname(job_result_dir) basename = os.path.basename(job_result_dir) latest = os.path.join(basedir, "latest") + if os.path.exists(latest) and not os.path.islink(latest): + raise OSError('"%s" already exists and is not a symlink' % latest) try: os.unlink(latest) except OSError: