diff options
author | Rohan Garg <[email protected]> | 2020-03-30 19:12:00 +0200 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-04-02 10:53:05 +0000 |
commit | d0f836e5aef29c5887cb5f3d3cba2b1d7d5d78fd (patch) | |
tree | 8364a5bf188ec08a77a720d7bf38157abd5ff8f0 /.gitlab-ci/tracie | |
parent | 7b7dbd4fc832eb67a4afd013f8cb623cedcf0d51 (diff) |
tracie: Switch to using shutil.move for cross filesystem moves
When running tracie in a docker container, renaming files from
inside the container to a bind-mounted folder on the host causes
a invalid cross-device link due to os.rename limitations.
Switching to shutil allows us to overcome this.
Signed-off-by: Rohan Garg <[email protected]>
Reviewed-by: Eric Anholt <[email protected]>
Reviewed-by: Alexandros Frantzis <[email protected]>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4377>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4377>
Diffstat (limited to '.gitlab-ci/tracie')
-rw-r--r-- | .gitlab-ci/tracie/tracie.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/.gitlab-ci/tracie/tracie.py b/.gitlab-ci/tracie/tracie.py index 388a73423bf..efedcbc4880 100644 --- a/.gitlab-ci/tracie/tracie.py +++ b/.gitlab-ci/tracie/tracie.py @@ -8,6 +8,7 @@ import sys import tempfile import time import yaml +import shutil from pathlib import Path from PIL import Image @@ -128,9 +129,9 @@ def check_trace(repo_url, repo_commit, device_name, trace, expectation): trace_dir = os.path.split(trace['path'])[0] results_path = os.path.join(RESULTS_PATH, trace_dir, "test", device_name) os.makedirs(results_path, exist_ok=True) - os.rename(log_file, os.path.join(results_path, os.path.split(log_file)[1])) + shutil.move(log_file, os.path.join(results_path, os.path.split(log_file)[1])) if not ok or os.environ.get('TRACIE_STORE_IMAGES', '0') == '1': - os.rename(image_file, os.path.join(results_path, os.path.split(image_file)[1])) + shutil.move(image_file, os.path.join(results_path, os.path.split(image_file)[1])) return ok |