Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id CD7A1E00E58; Wed, 27 Jul 2016 05:15:27 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high * trust * [192.55.52.88 listed in list.dnswl.org] Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 7CF50E00E55 for ; Wed, 27 Jul 2016 05:15:26 -0700 (PDT) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP; 27 Jul 2016 05:15:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,429,1464678000"; d="scan'208";a="740428675" Received: from linux.intel.com ([10.54.29.200]) by FMSMGA003.fm.intel.com with ESMTP; 27 Jul 2016 05:15:19 -0700 Received: from ed.fi.intel.com (ed.fi.intel.com [10.237.72.179]) by linux.intel.com (Postfix) with ESMTP id 418136A4080; Wed, 27 Jul 2016 05:15:06 -0700 (PDT) From: Ed Bartosh To: toaster@yoctoproject.org Date: Wed, 27 Jul 2016 15:15:02 +0300 Message-Id: <1469621702-16729-1-git-send-email-ed.bartosh@linux.intel.com> X-Mailer: git-send-email 2.6.6 Subject: [PATCH] toaster: fix unhandled exception X-BeenThere: toaster@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Web based interface for BitBake List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jul 2016 12:15:27 -0000 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. Signed-off-by: Ed Bartosh --- bitbake/lib/toaster/orm/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py index caacc2a..0d78ef5 100644 --- a/bitbake/lib/toaster/orm/models.py +++ b/bitbake/lib/toaster/orm/models.py @@ -21,7 +21,7 @@ from __future__ import unicode_literals -from django.db import models, IntegrityError +from django.db import models, IntegrityError, DataError from django.db.models import F, Q, Sum, Count from django.utils import timezone from django.utils.encoding import force_bytes @@ -78,7 +78,7 @@ if 'sqlite' in settings.DATABASES['default']['ENGINE']: try: obj = self.create(**params) return obj, True - except IntegrityError: + except (IntegrityError, DataError): exc_info = sys.exc_info() try: return self.get(**lookup), False -- 2.6.6