summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Duraffort <remi.duraffort@linaro.org>2016-08-23 13:17:27 (GMT)
committerRémi Duraffort <remi.duraffort@linaro.org>2016-08-23 13:28:04 (GMT)
commit1a9ec2aec9172bd0cd3bcabbac762fc9fde1f774 (patch)
treec6eaaeca87a750dd77f9d61bef322546736a4a83
parentb8d312df3fa4a3644bc1a909a3d1d905c10e566b (diff)
downloadlava-dispatcher-1a9ec2aec9172bd0cd3bcabbac762fc9fde1f774.tar.gz
lava-dispatcher-1a9ec2aec9172bd0cd3bcabbac762fc9fde1f774.tar.xz
slave: put all tmp files into the same directory
All files related to a given job are now stored into /tmp/lava-dispatcher/slave/%{job_id}/ This does ease investigations when something is going wrong. Change-Id: I14abc9c96e64b3b10ca2f6af20ffbace70a60dd5
-rwxr-xr-xlava/dispatcher/lava-dispatcher-slave9
1 files changed, 4 insertions, 5 deletions
diff --git a/lava/dispatcher/lava-dispatcher-slave b/lava/dispatcher/lava-dispatcher-slave
index b429091..7de027b 100755
--- a/lava/dispatcher/lava-dispatcher-slave
+++ b/lava/dispatcher/lava-dispatcher-slave
@@ -152,12 +152,11 @@ class Job(object):
"""Start the process."""
out_file = os.path.join(self.base_dir, "out")
err_file = os.path.join(self.base_dir, "err")
- env_dut_tmp_path = None
+ env_dut = os.path.join(self.base_dir, "env.dut.yaml")
# Dump the environment variables in the tmp file.
if self.env_dut:
- env_dut_file_handle, env_dut_tmp_path = tempfile.mkstemp()
- with os.fdopen(env_dut_file_handle, 'w') as f:
+ with open(env_dut, 'w') as f:
f.write(self.env_dut)
try:
@@ -177,8 +176,8 @@ class Job(object):
args.extend(["--master-cert", self.master_cert,
"--slave-cert", self.slave_cert])
- if self.env_dut and env_dut_tmp_path:
- args.append("--env-dut-path=%s" % env_dut_tmp_path)
+ if self.env_dut:
+ args.append("--env-dut-path=%s" % env_dut)
self.proc = subprocess.Popen(
args,