Skip to content

Commit

Permalink
Merge pull request #14 from Neves-P/feature/disk_cleanup
Browse files Browse the repository at this point in the history
Use copytree
  • Loading branch information
Neves-Bot authored Jul 2, 2024
2 parents e3052e7 + 7a07249 commit c4dc9b5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions tasks/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,19 +381,19 @@ def comment_download_pr(base_repo_name, pr, download_pr_exit_code, download_pr_e

download_pr_comments_cfg = config.read_config()[config.SECTION_DOWNLOAD_PR_COMMENTS]
if error_stage == _ERROR_GIT_CLONE:
download_comment = (f"`{download_pr_error}`\n"
download_comment = (f"```{download_pr_error}```\n"
f"{download_pr_comments_cfg[config.DOWNLOAD_PR_COMMENTS_SETTING_GIT_CLONE_FAILURE]}"
f"\n{download_pr_comments_cfg[config.DOWNLOAD_PR_COMMENTS_SETTING_GIT_CLONE_TIP]}")
elif error_stage == _ERROR_GIT_CHECKOUT:
download_comment = (f"`{download_pr_error}`\n"
download_comment = (f"```{download_pr_error}```\n"
f"{download_pr_comments_cfg[config.DOWNLOAD_PR_COMMENTS_SETTING_GIT_CHECKOUT_FAILURE]}"
f"\n{download_pr_comments_cfg[config.DOWNLOAD_PR_COMMENTS_SETTING_GIT_CHECKOUT_TIP]}")
elif error_stage == _ERROR_CURL:
download_comment = (f"`{download_pr_error}`\n"
download_comment = (f"```{download_pr_error}```\n"
f"{download_pr_comments_cfg[config.DOWNLOAD_PR_COMMENTS_SETTING_CURL_FAILURE]}"
f"\n{download_pr_comments_cfg[config.DOWNLOAD_PR_COMMENTS_SETTING_CURL_TIP]}")
elif error_stage == _ERROR_GIT_APPLY:
download_comment = (f"`{download_pr_error}`\n"
download_comment = (f"```{download_pr_error}```\n"
f"{download_pr_comments_cfg[config.DOWNLOAD_PR_COMMENTS_SETTING_GIT_APPLY_FAILURE]}"
f"\n{download_pr_comments_cfg[config.DOWNLOAD_PR_COMMENTS_SETTING_GIT_APPLY_TIP]}")

Expand Down
2 changes: 1 addition & 1 deletion tasks/clean_up.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def move_to_trash_bin(trash_bin_dir, job_dirs):
# Remove event_xxx-yyy/run_nnn/ directories
pr_dirs = list(set(pr_dirs)) # get only unique dirs
for pr_dir in pr_dirs:
destination_dir = shutil.copy2(pr_dir, trash_bin_dir, follow_symlinks=True)
destination_dir = shutil.copytree(pr_dir, trash_bin_dir)
log(f"{funcname}(): copied {pr_dir} to {destination_dir}")
os.remove(pr_dir)
log(f"{funcname}(): removed {pr_dir}")
Expand Down

0 comments on commit c4dc9b5

Please sign in to comment.