Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 46E82E00DEB; Thu, 5 May 2016 06:13:31 -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 * [74.125.82.49 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-wm0-f49.google.com (mail-wm0-f49.google.com [74.125.82.49]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id C8943E00DE3 for ; Thu, 5 May 2016 06:13:26 -0700 (PDT) Received: by mail-wm0-f49.google.com with SMTP id g17so27139656wme.1 for ; Thu, 05 May 2016 06:13:26 -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=ElJiQ9AWIXJOWukQRvrjEgLVHpZ7u+llepX8jk1hn0E3Kb7je10iup1+w+Y7BtCV3Y kwhzR/m/QNIyoM43fHAvyz2nexS5alghOGlK3quxLOk8ZZmI+wt+Eqg8JEklqSmbguzW jrZjhvGLoyp52q0ObDctkMMTMrXXIPReWHp5d4ps/mE4wKkL7pnET2mas5RdKH8jS2sl H1dIGld1l4RjkaoIGR6PlcBqTvtXw0XkJNmYDm0OugZadFWZDb+/VCeCdf0GS3t/1sSz 2RVXfzwdetVbnxc2UwYxrPhQFFqhRYa8BriKZMOPvygPDl4WSIA90Jc+iImg02jgrCcb 4/Aw== 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=iT29MNu+n8vp1hl6dOZRSfBEXoyT8SvH3yKZGsseqB0mRwu0sfMPxz6uOkNQ3OVAmX 7nbBSSmlspxdcJzpqPFlCBhTepL4sLaFD9fVlO7nSFwMaTZhnKa/NOiKIchUyTY7pS2m tUCfREtMXYPlR6pUM2CRvWjYICnyRT/1LfJC52FdayHZ2SK1zQjGwcUY1ufgX3eKX0e+ 928nHdg528txcvymfn/MYeKLtINViR7jeElN6g9PcQwg6FI0c3jc95S/ZaqQnfHjwjav T1YyQfs5//GGLA4V7qv3iNzPZn25OGHoi5eNatPTU/t96Uf1c0LH6UqfgfpzrsiMPasv DYjg== X-Gm-Message-State: AOPr4FUOyhOmjGf9VFyCOHnP0GHDgAVXxAfOfWq2JRy8bI09OUptyzMpGk42OWJhNaNW0yGw X-Received: by 10.28.184.78 with SMTP id i75mr3563678wmf.36.1462454005722; Thu, 05 May 2016 06:13:25 -0700 (PDT) Received: from dorado.ger.corp.intel.com (genld-218-172.t-mobile.co.uk. [149.254.218.172]) by smtp.gmail.com with ESMTPSA id ug8sm9719755wjc.42.2016.05.05.06.13.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 05 May 2016 06:13:25 -0700 (PDT) From: Michael Wood To: toaster@yoctoproject.org Date: Thu, 5 May 2016 14:12:28 +0100 Message-Id: <1462453952-8837-2-git-send-email-michael.g.wood@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1462453952-8837-1-git-send-email-michael.g.wood@intel.com> References: <1461607497-17591-5-git-send-email-michael.g.wood@intel.com> <1462453952-8837-1-git-send-email-michael.g.wood@intel.com> Subject: [PATCH v2 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 13:13:31 -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