Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id CED7CE00D12; Thu, 25 Feb 2016 10:21:37 -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=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID 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_VALID Message has at least one valid DKIM or DK signature * 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily * valid Received: from mail-wm0-f52.google.com (mail-wm0-f52.google.com [74.125.82.52]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 628DBE00D13 for ; Thu, 25 Feb 2016 10:21:37 -0800 (PST) Received: by mail-wm0-f52.google.com with SMTP id b205so43147616wmb.1 for ; Thu, 25 Feb 2016 10:21:37 -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=8I51l212k8yIgPifwAkZFBOl3kPn+AOi/izt3ai71Ds=; b=1yS89IBTysuZOfB6bxhmxtH6ZDxGEbGc1mD80FLtOJfYDNpVSDiN3pYmPTu3Na/WQS cKDHR8+8QKvx+w9cZPmmETI8LKnNFkuV36efVozEt40pxQw8mPvCWE6d92hQmvrAlLTB TBS+PBxk7meHlgZxOGA8zQX0CrICBq35KzUmUzzbOhfGXKjD1vPMXhW+BpVdx7wkI6cA kIYQvu1NmdlbpvyRK3Df+QNsYkt8Z6t5GxL0wBn/jTHjVK3gWiSEI9tPXQoaLSxGOXiy KZvRusoiE84s9IAqSDl/wzRQGCIjmArxqtDU4OOO1bKtuqLTzHUq/1BgahDrCOyy+CBR 9KXg== 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=8I51l212k8yIgPifwAkZFBOl3kPn+AOi/izt3ai71Ds=; b=gU9Bqfx2xX/7oYMeaOIWwvgoTvGklTgP609/TueMpFt/+uVi6O7DRGYuByfLN0OsE/ wh1tLVAgKPrmEWM2rRt4PUKXhTNDX7gVmfvSFQGijj0tB/qYKpUCd8VPPh95SS2jK42G jJ3IUfgfmuiZzhG1VtbMAQsc9zm7BztalZsygaVRmQHhcdFTupk4VjK0BtS1lxhL6uR7 DMTJqRBOsQh4c6amCMNORL042d3Lwcj8gMezBQnqJqsDc9Jm3+TyoAJ6JT9tLkO2MtO4 2vq0OMBhx4lrw4ZAXHD+JjOt4Lq0x9gtUZvgMXOpavqyFbgck+41epcHBQd4X1796B4q AFNQ== X-Gm-Message-State: AG10YOT1ZoWPP/cels/nMZqQ6kqmK0F/paT60ivLQML0oSxhWpJgVDq1UrzuAKflWYPhgASE X-Received: by 10.194.90.229 with SMTP id bz5mr51392534wjb.143.1456424496545; Thu, 25 Feb 2016 10:21:36 -0800 (PST) Received: from draco.icx.intel.com ([83.217.123.106]) by smtp.gmail.com with ESMTPSA id az8sm3084010wjc.17.2016.02.25.10.21.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 25 Feb 2016 10:21:36 -0800 (PST) From: Michael Wood To: toaster@yoctoproject.org Date: Thu, 25 Feb 2016 18:21:22 +0000 Message-Id: <1456424485-6566-9-git-send-email-michael.g.wood@intel.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1456424485-6566-1-git-send-email-michael.g.wood@intel.com> References: <1456424485-6566-1-git-send-email-michael.g.wood@intel.com> Subject: [PATCH 08/11] 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: Thu, 25 Feb 2016 18:21:37 -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 | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/bitbake/lib/bb/ui/buildinfohelper.py b/bitbake/lib/bb/ui/buildinfohelper.py index 81abede..8e95d89 100644 --- a/bitbake/lib/bb/ui/buildinfohelper.py +++ b/bitbake/lib/bb/ui/buildinfohelper.py @@ -211,6 +211,15 @@ class ORMWrapper(object): assert isinstance(errors, int) assert isinstance(warnings, int) + if build.outcome == Build.CANCELLED: + return + try: + if build.buildrequest.state == BuildRequest.REQ_CANCELLING: + return + except AttributeError: + # We may not have a buildrequest if this is a command line build + pass + outcome = Build.SUCCEEDED if errors or taskfailures: outcome = Build.FAILED @@ -1398,9 +1407,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.1.4