[Pkg-debile-commits] [debile-master] 01/02: Remove UUIDs definitely

Léo Cavaillé leo.cavaille-guest at alioth.debian.org
Fri Aug 23 11:27:02 UTC 2013


This is an automated email from the git hooks/post-receive script.

leo.cavaille-guest pushed a commit to branch master
in repository debile-master.

commit 8ad258858efb9bb2bc3b86147137a80896335197
Author: Léo Cavaillé <leo at cavaille.net>
Date:   Fri Aug 23 13:18:17 2013 +0200

    Remove UUIDs definitely
---
 debile/master/incoming.py |    7 ++-----
 debile/master/orm.py      |    6 +-----
 debile/master/server.py   |   16 +++++++---------
 3 files changed, 10 insertions(+), 19 deletions(-)

diff --git a/debile/master/incoming.py b/debile/master/incoming.py
index 16467c5..aad2e20 100644
--- a/debile/master/incoming.py
+++ b/debile/master/incoming.py
@@ -10,7 +10,6 @@ from debile.master.server import Session
 
 import os
 import logging
-import uuid
 import datetime as dt
 
 def listize(entry):
@@ -227,8 +226,7 @@ def add_jobs(package):
     for type in listize(config.get('jobs', package.type)):
         # For source packages, use only unstable and set arch to all
         # so that any builder arch can take jobs
-        j = Job(uuid=uuid.uuid4(),
-                package=package,
+        j = Job(package=package,
                 suite=package.suite,
                 arch=package.arch,
                 type=type)
@@ -247,8 +245,7 @@ def add_jobs(package):
     if package.type == 'source' and config.getboolean('jobs', 'build-enabled'):
         for arch in listize(config.get('jobs', 'arches')):
             for compiler in listize(config.get('jobs', 'build-flavors')):
-                j = Job(uuid=uuid.uuid4(),
-                        arch=arch,
+                j = Job(arch=arch,
                         suite=package.suite,
                         type='build',
                         subtype=compiler,
diff --git a/debile/master/orm.py b/debile/master/orm.py
index 7e14d67..9a5bcf8 100644
--- a/debile/master/orm.py
+++ b/debile/master/orm.py
@@ -6,7 +6,6 @@ Base = declarative_base()
 
 from sqlalchemy.orm import relationship, backref
 from sqlalchemy import Column, Integer, String, DateTime, ForeignKey, Boolean
-from sqlalchemy.dialects.postgresql import UUID
 from sqlalchemy import types as sqltypes
 
 import datetime as dt
@@ -18,10 +17,7 @@ def row2dict(row):
     """
     d = {}
     for column in row.__table__.columns:
-        if column.name == 'uuid':
-            d[column.name] = str(getattr(row, column.name))
-        else:
-            d[column.name] = getattr(row, column.name)
+        d[column.name] = getattr(row, column.name)
     return d
 
 
diff --git a/debile/master/server.py b/debile/master/server.py
index f8b0afa..ce37e3c 100644
--- a/debile/master/server.py
+++ b/debile/master/server.py
@@ -234,11 +234,11 @@ class DebileMasterInterface(object):
         dscpath = dscpath[0]
         return dscpath.replace(config.get('paths', 'pool_path'), config.get('paths', 'pool_url'))
 
-    def get_write_location(self, job_uuid):
+    def get_write_location(self, job_id):
         """
-        Return the path where we put output files for this job UUID.
+        Return the path where we put output files for this job ID.
         """
-        path = os.path.join(config.get('paths', 'jobs_path'), str(job_uuid))
+        path = os.path.join(config.get('paths', 'jobs_path'), str(job_id))
         if not os.path.exists(path):
             os.makedirs(path)
         return path
@@ -277,9 +277,9 @@ class DebileMasterInterface(object):
         return jobs
 
     @machine_method
-    def forfeit_job(self, job_uuid):
+    def forfeit_job(self, job_id):
         session = Session()
-        j = session.query(Job).filter(Job.uuid == job_uuid).one()
+        j = session.query(Job).filter(Job.id == job_id).one()
         if j.machine != get_builder():
             return None  # meh
 
@@ -338,8 +338,6 @@ class DebileMasterInterface(object):
         #                job=job['_id'],
         #                failed=failed)
 
-        #uuid_path = uuid_to_path(job['_id'])
-
         #path = os.path.join(config['path']['jobs'], j.id)
         #if not os.path.exists(path):
         #    os.makedirs(path)
@@ -355,12 +353,12 @@ class DebileMasterInterface(object):
     #return rid
 
     @machine_method
-    def close_job(self, job_uuid, failed):
+    def close_job(self, job_id, failed):
         """
         Close a job after pushing reports / binaries up.
         """
         session = Session()
-        j = session.query(Job).filter(Job.uuid == job_uuid).one()
+        j = session.query(Job).filter(Job.id == job_id).one()
         j.finished_at = dt.datetime.utcnow()
         j.failed = failed
         session.commit()

-- 
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