[Pkg-debile-commits] [debile-master] 36/126: job feh
Sylvestre Ledru
sylvestre at alioth.debian.org
Mon Aug 19 14:56:10 UTC 2013
This is an automated email from the git hooks/post-receive script.
sylvestre pushed a commit to branch scan-build-html
in repository debile-master.
commit ee86481eae7e8b383f0c8a9c01d207a998ea10bb
Author: Paul Tagliamonte <tag at pault.ag>
Date: Mon May 27 22:38:00 2013 -0400
job feh
---
lucy/models/job.py | 14 ++++++++++++++
lucy/server.py | 27 ++++++++++++++++++---------
2 files changed, 32 insertions(+), 9 deletions(-)
diff --git a/lucy/models/job.py b/lucy/models/job.py
index 9cd64b8..0716ebe 100644
--- a/lucy/models/job.py
+++ b/lucy/models/job.py
@@ -64,6 +64,20 @@ class Job(LucyObject):
return v
@classmethod
+ def next_nonbuild_job(cls, types):
+ return cls.next_job(**{
+ "type": "build"
+ })
+
+ @classmethod
+ def next_build_job(cls, suites, arches):
+ return cls.next_job(**{
+ "type": "build",
+ "arch": {"$in": arches},
+ "suite": {"$in": suites},
+ })
+
+ @classmethod
def unfinished_jobs(cls, **kwargs):
k = kwargs.copy()
k.update({"finished_at": None})
diff --git a/lucy/server.py b/lucy/server.py
index 1f0e096..4ca5f6e 100644
--- a/lucy/server.py
+++ b/lucy/server.py
@@ -1,4 +1,4 @@
-from lucy import Machine, Job, Source, Binary
+from lucy import Machine, Job, Source, Binary, Report
from lucy.core import get_config
from xmlrpc.server import SimpleXMLRPCServer
@@ -73,17 +73,17 @@ class LucyInterface(object):
"""
return list(Job.assigned_jobs(get_builder_id()))
- def get_lint_job(self, types):
+ def get_new_build_job(self, suites, arches):
"""
- Get an unassigned lint job from type types.
+ Get an unassigned lint job from suite suites, arches arches
"""
- pass
+ return dict(Job.next_build_job(suites, arches))
- def get_build_job(self, suites, arches):
+ def get_new_nonbuild_job(self, types):
"""
- Get an unassigned build job that is both in suites and arches.
+ Get an unassigned lint job from type types.
"""
- pass
+ return dict(Job.next_nonbuild_job(types))
def submit_report(self, report, log, package, package_type, job, failed):
"""
@@ -96,13 +96,22 @@ class LucyInterface(object):
job - job ID this relates to
failed - was it able to complete properly
"""
- pass
+ report = Report(report=report,
+ log=log,
+ builder=get_builder_id(),
+ package=package,
+ package_type=package_type,
+ job=job,
+ failed=failed)
+ return report.save()
def close_job(self, job):
"""
Close a job after pushing reports / binaries up.
"""
- pass
+ j = Job.load(job)
+ j['finished_at'] = dt.datetime.utcnow()
+ return j.save()
# =================== ok, boring shit below ===================
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-debile/debile-master.git
More information about the Pkg-debile-commits
mailing list