Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 3DCB2E00DEF; Thu, 5 May 2016 09:21:17 -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.169 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-f169.google.com (mail-pf0-f169.google.com [209.85.192.169]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id AA1C6E00DEC for ; Thu, 5 May 2016 09:21:14 -0700 (PDT) Received: by mail-pf0-f169.google.com with SMTP id 77so39166491pfv.2 for ; Thu, 05 May 2016 09:21:14 -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=TxZPXDnhKv/4Om9ZlI4zrBY9MhWDXsLtNxwEPRKexWyBHFu5VQKpnQOmwAGIJBTwA6 nGbKtLDPRFYpGkcAYGslJLx9Kmd+Qa/UnITaFylYazxl4p51+GzZF5tI5hfc2twJvRGf gg5TlRE7rvgth6EUQRJtHKyNa+eYzr4QJAV6hpjc8UgEGWria2VZhrf7apB7r9xvCK5G 3sIHOr2On3JA99qE9k+nR4qHaggNPFPYLhD6H48gBy31uKfn2E0yGv91P9vnIKAdU1Ek T8sbGiDlIXbT6ZCnLl94e9f+yr7Lo7R6cLuMnzpvKNmim9UOxw0rO06Vs+p4xhPrq1tg EeQA== 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=HeO0cX7tJfDmlQS5bgDj2XZ/iyk6znYO/ea91etHj+WdPQN6ZdDydXu08II+vWfVfd bBi0pFhP9Wvx56/HI+MgC9KUHTr/o2FjdDjhsvx67pSCMWOmF6ofv6Fid2eZYDgQsjJa KxFi8r4E4ee39Jxd6D+mdaoPlA/PYGKePhNtDmODSk1OcRUZCzZEC3CjADU3rJ+jb/bX lp/c2+mzyedM93BQohPf8G91jIXt+eRUy4LDyj0oe/XETol+iQnlWlTNHc6iD4mJaJmp kyqYPuJc4sx0W3MJUTdAHxU64WayF2Fjafq/4F3Ra32U6E5yfry6sd3lJA8+zFVLi8jV qfzg== X-Gm-Message-State: AOPr4FWAcoLJk4SEryjduA4ERnp2Irxjrjqag0CiS+2s+SqXei8d+fxUsqWbVarqAViyD7sp X-Received: by 10.98.78.132 with SMTP id c126mr21721919pfb.129.1462465274151; Thu, 05 May 2016 09:21:14 -0700 (PDT) Received: from dorado.ger.corp.intel.com ([192.55.55.41]) by smtp.gmail.com with ESMTPSA id wy7sm14858813pab.5.2016.05.05.09.21.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 05 May 2016 09:21:13 -0700 (PDT) From: Michael Wood To: toaster@yoctoproject.org Date: Thu, 5 May 2016 17:20:58 +0100 Message-Id: <1462465262-17912-2-git-send-email-michael.g.wood@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1462465262-17912-1-git-send-email-michael.g.wood@intel.com> References: <1462465262-17912-1-git-send-email-michael.g.wood@intel.com> Subject: [PATCH v3 2/6] 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: Thu, 05 May 2016 16:21:17 -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