diff options
author | Ed Bartosh <ed.bartosh@linux.intel.com> | 2016-07-27 15:15:02 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-08-11 00:09:27 +0100 |
commit | 953ba7a221ff6a4f1472e686899d167e749126ef (patch) | |
tree | 75906d91f106de91bef5d25425a38b5bd6efcc02 /bitbake | |
parent | f6261da9c003a5f571b2cb5c1347fdf8c8d13547 (diff) | |
download | poky-953ba7a221ff6a4f1472e686899d167e749126ef.tar.gz |
bitbake: toaster: fix unhandled exception
manage.py lsupdates throws DataError exception if the recipe can't be
saved to the MySQL database:
django.db.utils.DataError: (1406, "Data too long for column 'license' at row 1"
Adding DataError exception to the list of exceptions should make
lsupdates to print a warning message and skip the recipe.
(Bitbake rev: 01891c13ae8dcba64e5cf79956f1b64c2afdaae3)
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r-- | bitbake/lib/toaster/orm/models.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py index 3da9a66d0c..1c9f3a9363 100644 --- a/bitbake/lib/toaster/orm/models.py +++ b/bitbake/lib/toaster/orm/models.py | |||
@@ -21,7 +21,7 @@ | |||
21 | 21 | ||
22 | from __future__ import unicode_literals | 22 | from __future__ import unicode_literals |
23 | 23 | ||
24 | from django.db import models, IntegrityError | 24 | from django.db import models, IntegrityError, DataError |
25 | from django.db.models import F, Q, Sum, Count | 25 | from django.db.models import F, Q, Sum, Count |
26 | from django.utils import timezone | 26 | from django.utils import timezone |
27 | from django.utils.encoding import force_bytes | 27 | from django.utils.encoding import force_bytes |
@@ -78,7 +78,7 @@ if 'sqlite' in settings.DATABASES['default']['ENGINE']: | |||
78 | try: | 78 | try: |
79 | obj = self.create(**params) | 79 | obj = self.create(**params) |
80 | return obj, True | 80 | return obj, True |
81 | except IntegrityError: | 81 | except (IntegrityError, DataError): |
82 | exc_info = sys.exc_info() | 82 | exc_info = sys.exc_info() |
83 | try: | 83 | try: |
84 | return self.get(**lookup), False | 84 | return self.get(**lookup), False |