From 786dd2f30160b59d3ba04f9a1d4e551d02327c4f Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Thu, 15 Jun 2017 16:12:11 -0400 Subject: [PATCH] MockModuleBuilder: move generated artifacts to the final directory, instead of copying them There's no good reason to have artifacts in both the thread-specific results directory and in the main results directory, so just move them across instead of copying them. https://pagure.io/fm-orchestrator/issue/591 --- module_build_service/builder/MockModuleBuilder.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/module_build_service/builder/MockModuleBuilder.py b/module_build_service/builder/MockModuleBuilder.py index ffd449cc..42c1b572 100644 --- a/module_build_service/builder/MockModuleBuilder.py +++ b/module_build_service/builder/MockModuleBuilder.py @@ -27,7 +27,6 @@ import os import koji import kobo.rpmlib import modulemd -import shutil import yaml import threading @@ -382,7 +381,7 @@ mdpolicy=group:primary # Copy files from thread-related resultsdire to the main resultsdir. for name in os.listdir(resultsdir): - shutil.copyfile(os.path.join(resultsdir, name), os.path.join(self.resultsdir, name)) + os.rename(os.path.join(resultsdir, name), os.path.join(self.resultsdir, name)) # We return BUILDING state here even when we know it is already # completed or failed, because otherwise utils.start_build_batch