aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek.chauhan@gmail.com>2008-08-30 20:11:28 +0530
committerNirbheek Chauhan <nirbheek.chauhan@gmail.com>2008-08-30 20:11:28 +0530
commitca2cf37c259a06eca1d02234631bc9046ceb5da0 (patch)
tree6f977ed509de9f538cc46d0f7da14054cfedd6eb /slave/autotua/jobuild
parentMake the slave system-installable and configurable (diff)
downloadautotua-ca2cf37c259a06eca1d02234631bc9046ceb5da0.tar.gz
autotua-ca2cf37c259a06eca1d02234631bc9046ceb5da0.tar.bz2
autotua-ca2cf37c259a06eca1d02234631bc9046ceb5da0.zip
Numerous small bugfixes for commit 5dc25d
* Compatibility with git-1.6 (git-* commands are gone) * atexit.register() needs a function *reference* you dope :) * job_data['atoms'] is no longer an array, but is a space-separated string * jobuild.name -> jobuild.atom (a while ago) * Replace string exceptions with Exception(); for compatibility with unicode objects sent by django-1.0 * jobtagedir is different when using a chroot and not (duh)
Diffstat (limited to 'slave/autotua/jobuild')
-rw-r--r--slave/autotua/jobuild/__init__.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/slave/autotua/jobuild/__init__.py b/slave/autotua/jobuild/__init__.py
index 54d3ca0..93732b6 100644
--- a/slave/autotua/jobuild/__init__.py
+++ b/slave/autotua/jobuild/__init__.py
@@ -38,15 +38,15 @@ class Jobuild(object):
parts = regex.findall(atom)
if not parts:
# FIXME: Custom exceptions
- raise 'Invalid atom %s' % atom
+ raise Exception('Invalid atom %s' % atom)
parts = parts[0]
if parts[3] and not parts[4]:
# FIXME: Custom exceptions
- raise 'Invalid atom %s' % atom
+ raise Exception('Invalid atom %s' % atom)
parts = (parts[0], parts[1], parts[2], parts[4],)
if (parts[0] and not parts[3]) or (parts[3] and not parts[0]):
# FIXME: Custom exceptions
- raise 'Invalid atom %s' % atom
+ raise Exception('Invalid atom %s' % atom)
return parts
def _get_all_pv_sorted(self, data):
@@ -80,7 +80,7 @@ class Jobuild(object):
if pv[-1] >= data['pv']:
data['pv'] = pv[-1]
else:
- raise 'No matching jobuild found for atom \"%s\"' % atom
+ raise Exception('No matching jobuild found for atom \"%s\"' % atom)
elif data['op'] == '<=':
pv = self._get_all_pv_sorted(data)
pv.reverse()
@@ -89,7 +89,7 @@ class Jobuild(object):
data['pv'] = i
break
if i == pv[-1]: # If it's the last pv..
- raise 'No matching jobuild found for atom \"%s\"' % atom
+ raise Exception('No matching jobuild found for atom \"%s\"' % atom)
return '%(maint)s/%(pn)s/%(pn)s-%(pv)s.jobuild' % data
class Processor(object):
@@ -130,17 +130,19 @@ class Processor(object):
def _msg(self, msg):
chroot = None
workdir = config.AUTOTUA_DIR
+ jobtagedir = self.jobuild.jobtagedir
if self.chroot:
chroot = self.chroot.chrootdir
workdir = config.CHAUTOTUA_DIR
- proc = daemon.Spawn(chroot, self.jobuild.jobtagedir, workdir, '\"%s\"/bin/jobuild.sh %s' % (workdir, msg))
+ jobtagedir = config.CHAUTOTUA_DIR+'/jobtage'
+ proc = daemon.Spawn(chroot, jobtagedir, workdir, '\"%s\"/bin/jobuild.sh %s' % (workdir, msg))
# XXX: This waits for process to close stderr.
# Replace with a loop during daemonisation
response = proc.process.stderr.read()[:-1] # Remove trailing newline
returncode = proc.process.returncode
if returncode and returncode < 0:
# FIXME: Custom exceptions
- raise 'Daemon died with exit code \'%s\'' % -returncode
+ raise Exception('Daemon died with exit code \'%s\'' % -returncode)
return response
class Resolver(object):