aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek.chauhan@gmail.com>2008-08-30 23:00:38 +0530
committerNirbheek Chauhan <nirbheek.chauhan@gmail.com>2008-08-30 23:00:38 +0530
commit31452d16ecb42bd4c1256d09e39ea72eca929af0 (patch)
tree12a78fde4bb8ddca18d3137a20ed26d3467a1ea6
parentUpdate TODOs. (diff)
downloadautotua-31452d16ecb42bd4c1256d09e39ea72eca929af0.tar.gz
autotua-31452d16ecb42bd4c1256d09e39ea72eca929af0.tar.bz2
autotua-31452d16ecb42bd4c1256d09e39ea72eca929af0.zip
Allow unprivileged users to parse jobuilds
If we can't write to the logfile, don't :p
-rw-r--r--slave/autotua/daemon/__init__.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/slave/autotua/daemon/__init__.py b/slave/autotua/daemon/__init__.py
index 9e52fb0..50f28f9 100644
--- a/slave/autotua/daemon/__init__.py
+++ b/slave/autotua/daemon/__init__.py
@@ -6,7 +6,7 @@
# Immortal lh!
#
-import subprocess
+import os, subprocess
from .. import config
class Spawn(object):
@@ -33,9 +33,11 @@ class Spawn(object):
# stderr goes to stdout
# stdout goes to self.logfile
if chroot:
- self.command = 'chroot \"%s\" /bin/bash -c \'%s\' 3>&2 2>&1 | tee -a \"%s\"' % (chroot, command, self.logfile)
+ self.command = 'chroot \"%s\" /bin/bash -c \'%s\' 3>&2 2>&1 ' % (chroot, command)
else:
- self.command = '/bin/bash -c \'%s\' 3>&2 2>&1 | tee -a \"%s\"' % (command, self.logfile)
+ self.command = '/bin/bash -c \'%s\' 3>&2 2>&1 ' % command
+ if os.access(self.logfile, os.W_OK):
+ self.command += '| tee -a \"%s\"' % self.logfile
self.process = self._init()
def _init(self):