From patchwork Sat Jun 29 05:01:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Atharva Lele X-Patchwork-Id: 1124669 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="DVDi43XP"; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45bM2V1fbpz9s4Y for ; Sat, 29 Jun 2019 15:02:42 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id B1D7787EAA; Sat, 29 Jun 2019 05:02:40 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PRl7dNMy5GS5; Sat, 29 Jun 2019 05:02:40 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 3C714882DB; Sat, 29 Jun 2019 05:02:40 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 362321BF296 for ; Sat, 29 Jun 2019 05:02:37 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 145EE882DB for ; Sat, 29 Jun 2019 05:02:37 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id urCEl3olKnLd for ; Sat, 29 Jun 2019 05:02:36 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pf1-f194.google.com (mail-pf1-f194.google.com [209.85.210.194]) by hemlock.osuosl.org (Postfix) with ESMTPS id 24CD0882DD for ; Sat, 29 Jun 2019 05:02:36 +0000 (UTC) Received: by mail-pf1-f194.google.com with SMTP id i189so3960408pfg.10 for ; Fri, 28 Jun 2019 22:02:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9GNpvtZK+DxoXUYvmQEyNM9aw+Bd5V+dFdknJmKNUlc=; b=DVDi43XPIebqOP79cQySwzh+vRNZM1lyryGlX5yAIQvwkcVF2mW10W8hhapDrobyTu b/FJFmBb/vfJcWNXWhCv9H5tiY7UKnPn+qMr0c6yPUUEevOTDKiLNKmXqy5cGNk9Qb68 T1S/KBHclZMcfqTuaYTaeaqGbD7vcrbz4e/CX4o2dXKk+Zba4R/Sz0CChhEZQiathjIl 2MCVJgeZ0wi6gOjlmRSOtl6n1Ql3j4161FpbYuJmCnP1fQxCzCgkMlQMGSmHMO9hKsLa ZHs6WPQcVSm0TbPeHz/2ObUBERB9m3zm9cRHLmccQ+wG05XWbOh0omEYnKkJdPqjw0dO v2zA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9GNpvtZK+DxoXUYvmQEyNM9aw+Bd5V+dFdknJmKNUlc=; b=GOLYGHa1v9FD/00/0QrNX3EtFr9N260RYiTEpjDBl3hKzLiOlwhTwbFBnzxjERmR1I sfoz+M2475zPpdmon9YZRZT2M7exZ/C0jh7xGDxueLp4gRi5RtqM3f5qs2ynGUlag3a+ cTqcRbjgUNkTOdeC7WMXi50t1wO+YEFlUKAj1nomuVBOReE3zm4F70/DhPiIPmHwASnd Q6aWKseOa/gS+B3p0L6zJDHdvmEkBy+L+rMIn4oZ9FgF88p7TH844ZX1bLC/yqC5o/S7 VtQC0oAMKSDtt1Yrp+mS0hL/NmXh4NRC+N/VgoAj6Sv2oePoiULBzElxwQB4ltxy0P5U XBjA== X-Gm-Message-State: APjAAAXqFS5iCwXAdqgldh7VF6cJuYJgRtTwtBx6hswFFiGTU6FtRrkt ZCakO0YCM6tXoXL2ZVSgMoOM3Iy97bsSo6kP X-Google-Smtp-Source: APXvYqx1gGBNEgnku4Xnj8vsp0y7pXWUcC/ZRO7h3tgXSPmfQ+sv3c5srxmK28EIQqg3MjVoasgU8w== X-Received: by 2002:a63:3f48:: with SMTP id m69mr12476766pga.17.1561784555307; Fri, 28 Jun 2019 22:02:35 -0700 (PDT) Received: from localhost.localdomain ([123.201.100.132]) by smtp.gmail.com with ESMTPSA id y14sm3313541pjr.13.2019.06.28.22.02.32 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 28 Jun 2019 22:02:34 -0700 (PDT) From: Atharva Lele To: buildroot@buildroot.org Date: Sat, 29 Jun 2019 10:31:52 +0530 Message-Id: <20190629050214.17852-5-itsatharva@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190629050214.17852-1-itsatharva@gmail.com> References: <20190629050214.17852-1-itsatharva@gmail.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH 05/27] autobuild-run: move http variables from kwargs to Builder class X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Atharva Lele , yann.morin.1998@free.fr, thomas.petazzoni@bootlin.com Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Signed-off-by: Atharva Lele Acked-by: Arnout Vandecappelle (Essensium/Mind) --- Changes v1 -> v2: - Explicitly state class constructor arguments --- scripts/autobuild-run | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/scripts/autobuild-run b/scripts/autobuild-run index a52d0e6..2c3da00 100755 --- a/scripts/autobuild-run +++ b/scripts/autobuild-run @@ -271,10 +271,14 @@ class SystemInfo: return not missing_requirements class Builder: - def __init__(self, instance, njobs, sysinfo): + def __init__(self, instance, njobs, sysinfo, + http_url, http_login, http_password): self.instance = instance self.njobs = njobs self.sysinfo = sysinfo + self.http_url = http_url + self.http_login = http_login + self.http_password = http_password def prepare_build(self, **kwargs): """Prepare for the next build of the specified instance @@ -681,11 +685,11 @@ class Builder: # none of the ones that are part of the standard library can # upload a file without writing dozens of lines of code. ret = subprocess.call(["curl", "-u", - "%s:%s" % (kwargs['http_login'], kwargs['http_password']), + "%s:%s" % (self.http_login, self.http_password), "-H", "Expect:", "-F", "uploadedfile=@%s" % os.path.join(outputdir, "results.tar.bz2"), "-F", "uploadsubmit=1", - kwargs['http_url']], + self.http_url], stdout=log, stderr=log) if ret != 0: log_write(log, "INFO: results could not be submitted, %d" % ret) @@ -848,11 +852,11 @@ def main(): builder = Builder( instance = i, njobs = args['--njobs'], - sysinfo = sysinfo) + sysinfo = sysinfo, + http_url = args['--http-url'], + http_login = args['--http-login'], + http_password = args['--http-password']) p = multiprocessing.Process(target=builder.run_instance, kwargs=dict( - http_url = args['--http-url'], - http_login = args['--http-login'], - http_password = args['--http-password'], submitter = args['--submitter'], make_opts = (args['--make-opts'] or ''), nice = (args['--nice'] or 0),