diff options
author | Alexandru DAMIAN <alexandru.damian@intel.com> | 2015-08-18 17:28:54 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-08-19 18:05:54 +0100 |
commit | c159b3c1175d554f1cc60a41e1287d9ca4b3962f (patch) | |
tree | 009a95e322bf0d583f8c0b4dcc3b948c23132bf1 /bitbake | |
parent | be4636aef280f858397d712d0d25dcc758c782f2 (diff) | |
download | poky-c159b3c1175d554f1cc60a41e1287d9ca4b3962f.tar.gz |
bitbake: toaster: do not stop data import on bad data
The layer data update in Layer source needlessly stops
processing by throwing an Exception when bad layer data cannot
be inserted in the database (e.g. invalid dependencies).
This patch changes the behaviour to ignore bad data, and
continue with data import after detailed logging through the
logging system.
[YOCTO #7955]
(Bitbake rev: e0911e408db4fa07086738fe11121b173b4d1cf5)
Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r-- | bitbake/lib/toaster/orm/models.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py index c3fb766cf4..de0070272e 100644 --- a/bitbake/lib/toaster/orm/models.py +++ b/bitbake/lib/toaster/orm/models.py | |||
@@ -19,7 +19,7 @@ | |||
19 | # with this program; if not, write to the Free Software Foundation, Inc., | 19 | # with this program; if not, write to the Free Software Foundation, Inc., |
20 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | 20 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
21 | 21 | ||
22 | from django.db import models | 22 | from django.db import models, IntegrityError |
23 | from django.db.models import F, Q, Avg, Max | 23 | from django.db.models import F, Q, Avg, Max |
24 | from django.utils import timezone | 24 | from django.utils import timezone |
25 | 25 | ||
@@ -938,7 +938,7 @@ class LayerIndexLayerSource(LayerSource): | |||
938 | try: | 938 | try: |
939 | dependlist[lv].append(Layer_Version.objects.get(layer_source = self, layer__up_id = ldi['dependency'], up_branch = lv.up_branch)) | 939 | dependlist[lv].append(Layer_Version.objects.get(layer_source = self, layer__up_id = ldi['dependency'], up_branch = lv.up_branch)) |
940 | except Layer_Version.DoesNotExist: | 940 | except Layer_Version.DoesNotExist: |
941 | logger.warning("Cannot find layer version %s dep:%s up_brach:%s" % (self, ldi['dependency'], lv.up_branch)) | 941 | logger.warning("Cannot find layer version (ls:%s), up_id:%s lv:%s" % (self, ldi['dependency'], lv)) |
942 | 942 | ||
943 | for lv in dependlist: | 943 | for lv in dependlist: |
944 | LayerVersionDependency.objects.filter(layer_version = lv).delete() | 944 | LayerVersionDependency.objects.filter(layer_version = lv).delete() |
@@ -989,8 +989,8 @@ class LayerIndexLayerSource(LayerSource): | |||
989 | if 'inherits' in ri: | 989 | if 'inherits' in ri: |
990 | ro.is_image = 'image' in ri['inherits'].split() | 990 | ro.is_image = 'image' in ri['inherits'].split() |
991 | ro.save() | 991 | ro.save() |
992 | except Exception: | 992 | except IntegrityError as e: |
993 | logger.warning("Duplicate Recipe, ignoring: %s " % vars(ro)) | 993 | logger.debug("Failed saving recipe, ignoring: %s (%s:%s)" % (e, ro.layer_version, ri['filepath']+"/"+ri['filename'])) |
994 | if not connection.features.autocommits_when_autocommit_is_off: | 994 | if not connection.features.autocommits_when_autocommit_is_off: |
995 | transaction.set_autocommit(True) | 995 | transaction.set_autocommit(True) |
996 | 996 | ||