Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 186B1E00C52; Mon, 22 Feb 2016 03:31:47 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW 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] * 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily * valid * -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature * -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low * trust * [209.85.220.54 listed in list.dnswl.org] Received: from mail-pa0-f54.google.com (mail-pa0-f54.google.com [209.85.220.54]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id C0492E00C4F for ; Mon, 22 Feb 2016 03:31:31 -0800 (PST) Received: by mail-pa0-f54.google.com with SMTP id fy10so89830205pac.1 for ; Mon, 22 Feb 2016 03:31:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=6wYeNt30Xu0Y9amZakf5cWlC2e1NV56xdtd3gzNp9I8=; b=DTcaXomfXY03cUiaDoFjkVex/q1hWCmLiRLeXiwufczejdgCr/uxtHVDacWi/2rtis Xx/DQwlecv1TUFM+797l5nD/4jbVa88jBfiHOnopKl+u6IW+hMpt+Jawmv0FEJETbLHo lhFVLnRDKH63BlE9Q9lAGUYf1+5I/DbVbuBV3mOpr1A/wpTkAZJg/pZ04okBiVZlxyhl Sc/hGJ4M8fgp5k9L4EIFeu0lVwXVzzIs35mCGnL6Q17p4eAMYhr9jjhknznZPHuGLHwf eo7NCdC0eQQU21oLEeZcwhJNneNT9kYmzXgAtx3PtC/7gNj1txJrJ0qeFvFS7YtoKOHa pNmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=6wYeNt30Xu0Y9amZakf5cWlC2e1NV56xdtd3gzNp9I8=; b=WCsRXhIhPhF86365XGBCF2SXkWnyqdia4blN4Vggz9QcbC1dA7IvliOAT01Wz4CWcs 3Jm9Y9djDjLyOV5iCon3aRB3EkKq0W6zml8Lf0HQKbkq/9cGg7efc3G4pBLoCf1tBELp atPmxpbuuucSjKAM1EgwtwTyYa1OfbEWgKrnJRczn7+3sn+b0XfbDYn20/keoYMB3JMo 5awO/7Ihyk7wOIUF1yo1CSVNAKTRIwRKoMQH7redlKmLY+nN6/kW1AZEl2m0mTeIoYwz mXNHvBelQWeTSaUMn8TqcvS4pGKpPdmGLDRe6pZUVueOESAYVbp5Jyyf+qNkjizPRfsi EkOw== X-Gm-Message-State: AG10YOSGH/x45PIk718VXDfgl3FlyGGPGw6oMAFA8P8L95ofxt7RTaTN/765IjE0obQpQbfl X-Received: by 10.66.157.161 with SMTP id wn1mr37507737pab.146.1456140690869; Mon, 22 Feb 2016 03:31:30 -0800 (PST) Received: from dorado.ger.corp.intel.com (fmdmzpr01-ext.fm.intel.com. [192.55.54.36]) by smtp.gmail.com with ESMTPSA id n78sm36216801pfb.53.2016.02.22.03.31.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 22 Feb 2016 03:31:30 -0800 (PST) From: Michael Wood To: toaster@yoctoproject.org Date: Mon, 22 Feb 2016 11:31:04 +0000 Message-Id: <1456140666-5344-9-git-send-email-michael.g.wood@intel.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1456140666-5344-1-git-send-email-michael.g.wood@intel.com> References: <1456140666-5344-1-git-send-email-michael.g.wood@intel.com> Subject: [PATCH 08/10] buildinfohelper: Add handler for cancelling a build 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: Mon, 22 Feb 2016 11:31:47 -0000 When a build is cancelled the build (action) is complete if it has been caused the request being cancelled then update the build outcome accordingly. Signed-off-by: Michael Wood --- bitbake/lib/bb/ui/buildinfohelper.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/bitbake/lib/bb/ui/buildinfohelper.py b/bitbake/lib/bb/ui/buildinfohelper.py index 81abede..164fb91 100644 --- a/bitbake/lib/bb/ui/buildinfohelper.py +++ b/bitbake/lib/bb/ui/buildinfohelper.py @@ -211,6 +211,13 @@ class ORMWrapper(object): assert isinstance(errors, int) assert isinstance(warnings, int) + if build.outcome == Build.CANCELLED: + return + + if build.buildrequest and \ + build.buildrequest.state == BuildRequest.REQ_CANCELLING: + return + outcome = Build.SUCCEEDED if errors or taskfailures: outcome = Build.FAILED @@ -1398,9 +1405,17 @@ class BuildInfoHelper(object): be.lock = BuildEnvironment.LOCK_LOCK be.save() br = BuildRequest.objects.get(pk = br_id) + + # if we're 'done' because we got cancelled update the build outcome + if br.state == BuildRequest.REQ_CANCELLING: + logger.info("Build cancelled") + br.build.outcome = Build.CANCELLED + br.build.save() + errorcode = 0 + if errorcode == 0: # request archival of the project artifacts - br.state = BuildRequest.REQ_ARCHIVE + br.state = BuildRequest.REQ_COMPLETED else: br.state = BuildRequest.REQ_FAILED br.save() -- 2.5.0