summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2015-10-01 14:19:56 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-10-12 14:37:50 +0100
commit4d76a9e418fd98a7882aa29f974a7389f9689314 (patch)
treea156db82e522e8fed2ed76dd7ad0864d17716915
parent065652b9c649135f9e2fc5d9ba90e98f560dccdd (diff)
downloadbitbake-4d76a9e418fd98a7882aa29f974a7389f9689314.tar.gz
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] Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--lib/toaster/orm/models.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/toaster/orm/models.py b/lib/toaster/orm/models.py
index 6c28726bd..567732518 100644
--- a/lib/toaster/orm/models.py
+++ b/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)