diff options
author | Ed Bartosh <ed.bartosh@linux.intel.com> | 2016-05-10 11:04:49 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-06-02 08:24:03 +0100 |
commit | 7c44d883b432cbededb1e2620d3823e603fd25c0 (patch) | |
tree | 969e1a0f08c3dae69560f2dd48b92cf6d3f9cc24 /bitbake/lib/toaster/bldcontrol/models.py | |
parent | 8a93f5f32e141b4d153156152b9aeb1af25325ba (diff) | |
download | poky-7c44d883b432cbededb1e2620d3823e603fd25c0.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: 9dd9c1393a84d1110c647e84253af8e0bb6acc45)
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/bldcontrol/models.py')
-rw-r--r-- | bitbake/lib/toaster/bldcontrol/models.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bitbake/lib/toaster/bldcontrol/models.py b/bitbake/lib/toaster/bldcontrol/models.py index e09ad20dc3..f06c562a38 100644 --- a/bitbake/lib/toaster/bldcontrol/models.py +++ b/bitbake/lib/toaster/bldcontrol/models.py | |||
@@ -1,7 +1,7 @@ | |||
1 | from __future__ import unicode_literals | 1 | from __future__ import unicode_literals |
2 | from django.db import models | 2 | from django.db import models |
3 | from django.core.validators import MaxValueValidator, MinValueValidator | 3 | from django.core.validators import MaxValueValidator, MinValueValidator |
4 | from django.utils.encoding import force_bytes | 4 | from django.utils.encoding import force_text |
5 | from orm.models import Project, ProjectLayer, ProjectVariable, ProjectTarget, Build, Layer_Version | 5 | from orm.models import Project, ProjectLayer, ProjectVariable, ProjectTarget, Build, Layer_Version |
6 | 6 | ||
7 | import logging | 7 | import 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* |