mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-04-15 19:20:37 +08:00
Combine mock stderr and stdout logs
Mock doesn't normally log anything to stdout - so it's confusing to mention separate logs in the messages. Combine the two output streams together. (This is what koji does as well.)
This commit is contained in:
@@ -646,11 +646,9 @@ class MockModuleBuilder(GenericBuilder):
|
||||
mock_config = os.path.join(
|
||||
self.configdir, "mock-%s.cfg" % str(threading.current_thread().name))
|
||||
|
||||
# Open the logs to which we will forward mock stdout/stderr.
|
||||
mock_stdout_log = open(
|
||||
os.path.join(self.resultsdir, artifact_name + "-mock-stdout.log"), "w")
|
||||
mock_stderr_log = open(
|
||||
os.path.join(self.resultsdir, artifact_name + "-mock-stderr.log"), "w")
|
||||
# Open the log to which we will forward mock stdout/stderr.
|
||||
mock_output_log = open(
|
||||
os.path.join(self.resultsdir, artifact_name + "-mock-output.log"), "w")
|
||||
|
||||
srpm = artifact_name
|
||||
resultsdir = builder.resultsdir
|
||||
@@ -658,12 +656,11 @@ class MockModuleBuilder(GenericBuilder):
|
||||
# Initialize mock.
|
||||
execute_cmd(
|
||||
["mock", "-v", "-r", mock_config, "--init"],
|
||||
stdout=mock_stdout_log,
|
||||
stderr=mock_stderr_log,
|
||||
output=mock_output_log,
|
||||
)
|
||||
|
||||
# Start the build and store results to resultsdir
|
||||
builder.build(mock_stdout_log, mock_stderr_log)
|
||||
builder.build(mock_output_log)
|
||||
srpm = find_srpm(resultsdir)
|
||||
|
||||
# Emit messages simulating complete build. These messages
|
||||
@@ -687,8 +684,7 @@ class MockModuleBuilder(GenericBuilder):
|
||||
with open(os.path.join(resultsdir, "status.log"), "w") as f:
|
||||
f.write("failed\n")
|
||||
|
||||
mock_stdout_log.close()
|
||||
mock_stderr_log.close()
|
||||
mock_output_log.close()
|
||||
|
||||
self._save_log(resultsdir, "state.log", artifact_name)
|
||||
self._save_log(resultsdir, "root.log", artifact_name)
|
||||
@@ -810,8 +806,8 @@ class BaseBuilder(object):
|
||||
self.resultsdir = resultsdir
|
||||
self.cmd = ["mock", "-v", "-r", config, "--no-clean", "--resultdir=%s" % resultsdir]
|
||||
|
||||
def build(self, stdout, stderr):
|
||||
execute_cmd(self.cmd, stdout=stdout, stderr=stderr)
|
||||
def build(self, output):
|
||||
execute_cmd(self.cmd, output=output)
|
||||
|
||||
|
||||
class SRPMBuilder(BaseBuilder):
|
||||
|
||||
Reference in New Issue
Block a user