summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2016-05-10 08:04:49 (GMT)
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-05-16 22:32:41 (GMT)
commit51738f9fa5aa07f19f24dd4a55b1fd8d210c6b3f (patch)
tree3e82958b999f9fca53518061bb5f79b60ce21777
parentb28ea877e096bbfc89be8851f971383a2243e99d (diff)
downloadpoky-51738f9fa5aa07f19f24dd4a55b1fd8d210c6b3f.tar.gz
bitbake: toaster: use force_text instead of force_bytes
Usage of force_bytes in BuildRequest.__str__ method caused python 3 to throw "__str__ returned non-string (type bytes)" error. Replaced force_bytes with force_text to make the code working on both python 2 and python 3. [YOCTO #9584] (Bitbake rev: 7b89d3781bf0de1e52e8aef5b77d94c7fb462bf4) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py4
-rw-r--r--bitbake/lib/toaster/bldcontrol/models.py4
2 files changed, 4 insertions, 4 deletions
diff --git a/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py b/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py
index 5532b9d..b630fe6 100644
--- a/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py
+++ b/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py
@@ -54,8 +54,8 @@ class Command(NoArgsCommand):
54 logger.debug("runbuilds: No build env") 54 logger.debug("runbuilds: No build env")
55 return 55 return
56 56
57 logger.debug("runbuilds: starting build %s, environment %s" % \ 57 logger.info("runbuilds: starting build %s, environment %s" % \
58 (str(br).decode('utf-8'), bec.be)) 58 (br, bec.be))
59 59
60 # let the build request know where it is being executed 60 # let the build request know where it is being executed
61 br.environment = bec.be 61 br.environment = bec.be
diff --git a/bitbake/lib/toaster/bldcontrol/models.py b/bitbake/lib/toaster/bldcontrol/models.py
index e09ad20..f06c562 100644
--- a/bitbake/lib/toaster/bldcontrol/models.py
+++ b/bitbake/lib/toaster/bldcontrol/models.py
@@ -1,7 +1,7 @@
1from __future__ import unicode_literals 1from __future__ import unicode_literals
2from django.db import models 2from django.db import models
3from django.core.validators import MaxValueValidator, MinValueValidator 3from django.core.validators import MaxValueValidator, MinValueValidator
4from django.utils.encoding import force_bytes 4from django.utils.encoding import force_text
5from orm.models import Project, ProjectLayer, ProjectVariable, ProjectTarget, Build, Layer_Version 5from orm.models import Project, ProjectLayer, ProjectVariable, ProjectTarget, Build, Layer_Version
6 6
7import logging 7import logging
@@ -121,7 +121,7 @@ class BuildRequest(models.Model):
121 return self.brvariable_set.get(name="MACHINE").value 121 return self.brvariable_set.get(name="MACHINE").value
122 122
123 def __str__(self): 123 def __str__(self):
124 return force_bytes('%s %s' % (self.project, self.get_state_display())) 124 return force_text('%s %s' % (self.project, self.get_state_display()))
125 125
126# These tables specify the settings for running an actual build. 126# These tables specify the settings for running an actual build.
127# They MUST be kept in sync with the tables in orm.models.Project* 127# They MUST be kept in sync with the tables in orm.models.Project*