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
This commit is contained in:
Owen W. Taylor
2017-06-15 16:12:11 -04:00
parent 280facdbe0
commit 786dd2f301

View File

@@ -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