From: Michael Tremer Date: Fri, 21 Jul 2023 15:11:52 +0000 (+0000) Subject: database: Replace more occurences of the UUID type X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=afc35be4bf97156445eba62802cf68a65e06b5c7;p=pbs.git database: Replace more occurences of the UUID type Signed-off-by: Michael Tremer --- diff --git a/src/buildservice/builders.py b/src/buildservice/builders.py index c412073d..753e3419 100644 --- a/src/buildservice/builders.py +++ b/src/buildservice/builders.py @@ -827,7 +827,7 @@ class Builder(base.DataObject): "type" : "job", "data" : { # Add job information - "id" : job.uuid, + "id" : "%s" % job.uuid, "name" : "%s" % job, "arch" : job.arch, diff --git a/src/buildservice/builds.py b/src/buildservice/builds.py index bd22f117..d702946e 100644 --- a/src/buildservice/builds.py +++ b/src/buildservice/builds.py @@ -1313,7 +1313,7 @@ class Group(base.DataObject): table = "build_groups" def __str__(self): - return self.uuid + return "%s" % self.uuid def __iter__(self): return iter(self.builds) diff --git a/src/buildservice/jobs.py b/src/buildservice/jobs.py index 9db4d90c..52736240 100644 --- a/src/buildservice/jobs.py +++ b/src/buildservice/jobs.py @@ -791,13 +791,15 @@ class Job(base.DataObject): return q async def _import_logfile(self, upload): + uuid = "%s" % self.uuid + # Create some destination path path = self.backend.path( "logs", "jobs", - self.uuid[0:2], - self.uuid[2:4], - "%s.log.gz" % self.uuid[4:], + uuid[0:2], + uuid[2:4], + "%s.log.gz" % uuid[4:], ) # Create parent directory diff --git a/src/web/uploads.py b/src/web/uploads.py index 0b15a6b1..70e3b4c0 100644 --- a/src/web/uploads.py +++ b/src/web/uploads.py @@ -102,7 +102,7 @@ class APIv1IndexHandler(base.APIMixin, tornado.web.RequestHandler): # Send the ID of the upload back to the client self.finish({ - "id" : upload.uuid, + "id" : "%s" % upload.uuid, "expires_at" : upload.expires_at.isoformat(), })