Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 21760E00C65; Fri, 6 May 2016 14:26:42 -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.177 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-f177.google.com (mail-pf0-f177.google.com [209.85.192.177]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id E3321E00C4C for ; Fri, 6 May 2016 14:26:38 -0700 (PDT) Received: by mail-pf0-f177.google.com with SMTP id 206so53925014pfu.0 for ; Fri, 06 May 2016 14:26:38 -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=z/79Vb74mcN/fKhlTipVA4zmtvK5xexqVJtM8Lkasqas7gwToHUxsvEdElWFrwb0F3 T/b6WL5w+ggiACFfbnCoJELgTA55OSiaS/zUooAECo7dQpW7RjDmBhb/SyhY9QMRlAbc ew8HVZ5t13U087n5/sRA5lFRkC39MRsrwe9vlsQ86bbGY/05Fn6aOqf9hMM8VwXlQW4F JubVQUQGRiB+mZ+x9RbtjMIOUsb9Q6Rd/FBq3kH6Gig2I/jbRaRlAw/lTk5A4HLnlWi+ JALiIJrhsCTQOszFD3tBQM0lJ1Dhn19ILUGyr/J0ryz8aQcdofSJAMUSXrMbqnoiGw5h iIKg== 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=YO06htR1NW+A0TUhHRX4VKy7zP2TUSJeHTVLKr7/x1+sbgRQdO6R+2dOhfLvuXCmYz F/5mqIPmYMiUIFyPR2G3eyQOKXyLrA/fA+i8YGbnmuLSSFPAgvWCvmmjwmFrtk9BwO0v DPkYO9nWrjJ/58pHk6F5LXCKRRkKIL//Pc2WsY6WNOe3SKIWhWa42m/xEveGS4HgfYFu Dt1Z2+F8W7bB4jyG9qp3njZS4zKuNAyOJhmmOs9xFJVSiX7pIzRcIJu3FFsPDoNU7dVD cvBw4PJxfd1h9bsoeHEhLGXzVVa7qRAT+NHaJyNn8+wpUulbbZRDsHzjsIeg4YPU9kkE Uj2A== X-Gm-Message-State: AOPr4FXpYGsdAn7C4RFc4NaOpQH6simmaICCqC3WzdBFl+slRH12T4dRyjirZx+PUa3e+w/V X-Received: by 10.98.46.71 with SMTP id u68mr32209922pfu.136.1462569998239; Fri, 06 May 2016 14:26:38 -0700 (PDT) Received: from dorado.ger.corp.intel.com ([192.55.55.41]) by smtp.gmail.com with ESMTPSA id d184sm23136651pfc.27.2016.05.06.14.26.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 06 May 2016 14:26:37 -0700 (PDT) From: Michael Wood To: toaster@yoctoproject.org Date: Fri, 6 May 2016 22:26:21 +0100 Message-Id: <1462569985-12670-3-git-send-email-michael.g.wood@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1462569985-12670-1-git-send-email-michael.g.wood@intel.com> References: <1462569985-12670-1-git-send-email-michael.g.wood@intel.com> Subject: [PATCH v4 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: Fri, 06 May 2016 21:26:42 -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