Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id CEFD4E00AAF; Mon, 25 Apr 2016 11:05:14 -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=-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: * -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low * trust * [209.85.192.178 listed in list.dnswl.org] * -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 Received: from mail-pf0-f178.google.com (mail-pf0-f178.google.com [209.85.192.178]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 6B22FE00931 for ; Mon, 25 Apr 2016 11:05:09 -0700 (PDT) Received: by mail-pf0-f178.google.com with SMTP id c189so24705526pfb.3 for ; Mon, 25 Apr 2016 11:05:09 -0700 (PDT) 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=bNwB9P0pT5cS2DZaeH2+FT8kVlg7HlOuiF3bQTrV9BU=; b=X5M3Dyd2YxaHY/yzZiLtx0Eiwc+Z1kI/Zll/gA1yY677XoC011uCLxEN44hKq/eWX9 gz8mMxK5BUdfRtayK2+YdBD//KN0NqfEA1K01S6mMF1qf3xYKfTh24/BUsXkjTIO6LpW 6V3BJFObWhktcejoz8UUPIcDd6LqRK1pJKPnChudWkz2jf4YHtxXGNmNKfMT4SF3euhW cKGFwakE/s2Ds3xCfECgNowDEl/lf/ZVD60N10TZH8wzntpr9in6oRpGeg3F4TFm9UqB AzLRsI/HLBWxxYo+IjHBs2BX05968wEDZ26/CMuBjENvSKL7opr0FuSKIIKPzBEVUU3E dtPw== 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=bNwB9P0pT5cS2DZaeH2+FT8kVlg7HlOuiF3bQTrV9BU=; b=GakhUppexXcjTNy9HXGnMTjgLfTw2S/pZgK4VVzTPafmb/p7WQAW/yyhMdMbtRjIC9 lJXJ/WIuJwf9Iwh1s6dnyje0Sy6vLGLrZ1eok7FLX4Zap0Y7qtLUacPW8ZAVxWyCb7ne e+c6nAYHlpHGvORmhB7yCpZKJQZbBW4tgdBPez+PBexB8Q+YUfxHJ0tVObKJS4fAqqL+ pKEJUDrHduHfGq81al7q1u6raRlFWpcjO4S3Kj2EmVEab3ENbE2HPNvWsEqHZ0Qb1Ce7 A9unkWl1JXuGxOWQCT0mwuxXjHAl8+JlzKOJBbvTonAf2ChjtHDy1dC71Ct8kd3y0C7q FSqQ== X-Gm-Message-State: AOPr4FXUowMcWC907LYQGRaAvm7ud72fozkQaduSt5J60fu2bwTFt0QfveEFX0AIVXPSxwqc X-Received: by 10.98.104.6 with SMTP id d6mr2319956pfc.77.1461607509091; Mon, 25 Apr 2016 11:05:09 -0700 (PDT) Received: from dorado.ger.corp.intel.com ([192.55.54.44]) by smtp.gmail.com with ESMTPSA id c190sm15573288pfb.33.2016.04.25.11.05.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 25 Apr 2016 11:05:08 -0700 (PDT) From: Michael Wood To: toaster@yoctoproject.org Date: Mon, 25 Apr 2016 19:04:54 +0100 Message-Id: <1461607497-17591-2-git-send-email-michael.g.wood@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1461607497-17591-1-git-send-email-michael.g.wood@intel.com> References: <1461607497-17591-1-git-send-email-michael.g.wood@intel.com> Subject: [PATCH 2/5] toaster: runbuilds move the execution sequence out of the poll loop 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, 25 Apr 2016 18:05:14 -0000 Move the execution sequence for a build out of the polling loop and into it's own fuction. This means that we can call the function on it's own if we just want to trigger one build rather than infinite polling. This is something needed for the build tests. Signed-off-by: Michael Wood --- .../bldcontrol/management/commands/runbuilds.py | 30 ++++++++++++---------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py b/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py index 27289be..3b34fe0 100644 --- a/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py +++ b/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py @@ -158,22 +158,24 @@ class Command(NoArgsCommand): br.environment.lock = BuildEnvironment.LOCK_FREE br.environment.save() + def runbuild(self): + try: + self.cleanup() + except Exception as e: + logger.warn("runbuilds: cleanup exception %s" % str(e)) - def handle_noargs(self, **options): - while True: - try: - self.cleanup() - except Exception as e: - logger.warn("runbuilds: cleanup exception %s" % str(e)) + try: + self.archive() + except Exception as e: + logger.warn("runbuilds: archive exception %s" % str(e)) - try: - self.archive() - except Exception as e: - logger.warn("runbuilds: archive exception %s" % str(e)) + try: + self.schedule() + except Exception as e: + logger.warn("runbuilds: schedule exception %s" % str(e)) - try: - self.schedule() - except Exception as e: - logger.warn("runbuilds: schedule exception %s" % str(e)) + def handle_noargs(self, **options): + while True: + self.runbuild() time.sleep(1) -- 2.7.4