From fa3e82d9527aa8c2ac4249d35d28515d471a3bb5 Mon Sep 17 00:00:00 2001 From: Ed Bartosh Date: Thu, 1 Oct 2015 14:19:56 -0700 Subject: bitbake: toaster: delete recipe if it can't be saved Due to Recipe model constraints some recipes can't be saved. However, they still can create incomplete records in the database. This causes all sorts of errors when Toaster operates with those objects. Removing them should fix those issues. [YOCTO #7969] (Bitbake rev: 4d76a9e418fd98a7882aa29f974a7389f9689314) Signed-off-by: Ed Bartosh Signed-off-by: brian avery Signed-off-by: Richard Purdie --- bitbake/lib/toaster/orm/models.py | 1 + 1 file changed, 1 insertion(+) (limited to 'bitbake/lib') diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py index 6c28726bd9..567732518a 100644 --- a/bitbake/lib/toaster/orm/models.py +++ b/bitbake/lib/toaster/orm/models.py @@ -1011,6 +1011,7 @@ class LayerIndexLayerSource(LayerSource): ro.save() except IntegrityError as e: logger.debug("Failed saving recipe, ignoring: %s (%s:%s)" % (e, ro.layer_version, ri['filepath']+"/"+ri['filename'])) + ro.delete() if not connection.features.autocommits_when_autocommit_is_off: transaction.set_autocommit(True) -- cgit v1.2.3-54-g00ecf