From patchwork Sun Jul 7 05:28:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Atharva Lele X-Patchwork-Id: 1128557 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.138; helo=whitealder.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="J3TUcuL9"; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45hHFg0wntz9s8m for ; Sun, 7 Jul 2019 15:29:27 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id A515985BB0; Sun, 7 Jul 2019 05:29:25 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1J7gY7DEqucz; Sun, 7 Jul 2019 05:29:24 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 5D0E985D26; Sun, 7 Jul 2019 05:29:24 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id BDB0A1BF5DD for ; Sun, 7 Jul 2019 05:29:22 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id B15FB204CB for ; Sun, 7 Jul 2019 05:29:22 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vPDlw6GRjc7c for ; Sun, 7 Jul 2019 05:29:15 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pg1-f194.google.com (mail-pg1-f194.google.com [209.85.215.194]) by silver.osuosl.org (Postfix) with ESMTPS id 84AB220424 for ; Sun, 7 Jul 2019 05:29:06 +0000 (UTC) Received: by mail-pg1-f194.google.com with SMTP id u17so5542927pgi.6 for ; Sat, 06 Jul 2019 22:29:06 -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=P9sJ6e5bXM0uINj4uQIubtTSWTPFMDjlaGi829MtpzI=; b=J3TUcuL9srRqV5sRB30H8i1MVv9Lwpodpvm4tkkeKtiuC7zYYHLj1U1lujz68OlTP7 9T0l9Lots7ZJmKKl7WtNjcwVPJs/BLsglbzR1nTJdSOyXzTOR8juV98sNCQlndoFBDbt zyU22HFzSB5QiahlLvTYtpm+t0IZV5LOTAd3hi9+WUSVReDs0DRdH1FLQNUVw4DzRy1Q sGP/+ceYh1BupBDGlIxqPKx873NcuifNIiVg0rLmBzDFKJ7bhjeANXeN17CzhJdMOoXv po8Z5i0eMlqohIkGKOZ2jGNp2Rw78cN/IYyc8SZoBC2KcldP/aQhbQNLNpcMkJxg5lrv 3ZZw== 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=P9sJ6e5bXM0uINj4uQIubtTSWTPFMDjlaGi829MtpzI=; b=sxhleKguIXKBzPkMVQwuauJZe/BCt3g7ZouTxWBP/7zeVsV6eN9cQVMBm3dOySbtHh Xg8Kf0zjcxG+Zr0KiBxOKwFcbAXflYAD513Iy4Kznwz7t/c8oKVmv+cF9q3J+Wa+HNud TcyKP/1R+t6T1PbnEzRmPf0AuhtEbDSESDCipUODqffMgHc+MG8Nay+n2+aJQ2VU5G4k dnUqNLfKDRZjuqHrqgCxMbQMS6S3LeSn5aSRXepqFk2uJiQBX1R+C03xbIXrw0zX9jVo 7E4jn76S4VYdXuEm0t+nofuAz31ETJ0zxz9/vO4nWPj0hoiYZgMI/Z0uCwiJBl0QOMPW 7rgw== X-Gm-Message-State: APjAAAXw+MvoEiONAbyBx4vJ6BFH99vwQDCWCkFQ0VQmUHjFTlV5nHXi zLr5A/RON79d4wtZJ3MUZqN5Rm4WGLQLIQ== X-Google-Smtp-Source: APXvYqyfahmqHOZjmWNpS9HOg91/KU4TNQY3yIQ2Y2r1BMee2wIjl5DTIlyJpQa/MrcV9S7AqRzv4Q== X-Received: by 2002:a65:5a42:: with SMTP id z2mr14759265pgs.421.1562477345672; Sat, 06 Jul 2019 22:29:05 -0700 (PDT) Received: from localhost.localdomain ([123.201.194.71]) by smtp.gmail.com with ESMTPSA id j24sm18039214pgg.86.2019.07.06.22.29.03 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sat, 06 Jul 2019 22:29:05 -0700 (PDT) From: Atharva Lele To: buildroot@buildroot.org Date: Sun, 7 Jul 2019 10:58:05 +0530 Message-Id: <20190707052831.9469-5-itsatharva@gmail.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190707052831.9469-1-itsatharva@gmail.com> References: <20190707052831.9469-1-itsatharva@gmail.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v3 05/31] 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 - Fix whitespace issues --- scripts/autobuild-run | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/scripts/autobuild-run b/scripts/autobuild-run index ca2dd83..9d16ce5 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),