Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
# Store the time
self._set_attribute_now("finished_at")
- # XXX handle success status
+ # Did this build fail?
+ if not success:
+ # Clone the build
+ self.clone()
# Store message
self._set_attribute("message", message)
# Delete the job itself.
self.db.execute("DELETE FROM jobs WHERE id = %s", self.id)
+ def clone(self):
+ """
+ Clones this build job
+ """
+ job = self.backend.jobs.create(
+ build=self.build,
+ arch=self.arch,
+ test=self.test,
+ superseeds=self,
+ )
+
+ log.debug("Cloned job %s as %s" % (self, job))
+
+ return job
+
## Logging stuff
def log(self, action, user=None, state=None, builder=None, test_job=None):