From patchwork Wed Jul 3 18:31:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Atharva Lele X-Patchwork-Id: 1127058 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="BB8LDPWr"; 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 45f8q26T3Dz9sLt for ; Thu, 4 Jul 2019 04:32:30 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 441B086C02; Wed, 3 Jul 2019 18:32:29 +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 Hdh-XrcK5Ih0; Wed, 3 Jul 2019 18:32:28 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 5EC7486CC0; Wed, 3 Jul 2019 18:32:28 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 39E781BF321 for ; Wed, 3 Jul 2019 18:32:25 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 2D6AC86D81 for ; Wed, 3 Jul 2019 18:32: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 Q-zmMBLkYYj5 for ; Wed, 3 Jul 2019 18:32:21 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pf1-f195.google.com (mail-pf1-f195.google.com [209.85.210.195]) by whitealder.osuosl.org (Postfix) with ESMTPS id D35C686B2B for ; Wed, 3 Jul 2019 18:32:19 +0000 (UTC) Received: by mail-pf1-f195.google.com with SMTP id r7so1692144pfl.3 for ; Wed, 03 Jul 2019 11:32:19 -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=BB8LDPWr+FQyhUF4Dtauk6KMShl5kIQ2iyBYgtLlKEN8ju4ZG4rZS3EUZ7w9UMJS7J v0z9IRxAksXVhr7ocAlDC8/2DDqLaBkvcqge5QzjlXzgQ9zqt1akA19MrMpJzQPPp2HK wx6qlOdkxINwEaqB1AdHnV9hVzCG8IDLsZJBteU1U3fi99vWb+J/i3U4sHcvILz/Tssj 1wSB1KMeNNBzIxKmzKGU0ZYAi5iWG26voIPtqJlqAA7bryiwIeIl8EV511xJGcZLjXI8 STwxBiQn8N/cjjhDm9UlQEuDeIEhZwwSKUCYzG/13Zn9nTDDRAVzeufAX63H+wddxG3D gCbw== 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=dn5CLKw2jD2Xbi85HJUWE/HGe6nUbqcoGsa6XDbmOhTpD5uUfiSriQ0as+0TUI13tZ /0wLJqgget1wIl6etlKH6F1HxZr6xysNPu6snhZEzET836ukfD+L9DbZT9U6aA1B/xeO S5pEtFivAtZtG3/jwduinOQICskdsZmUxA8RwHGCYRg/9lUhTex2x+0RxtYuPuBR2ESc pkHERdsx4sC/087qNdOFgJFUACpZOsZBZc+5KgppwEHkDlc9H6epZrik0hsA7gveUtdv kGFCM7tz6ly5/sEuB/xs5l8jOTxj1BbtvK44XzkaJAq0CvxVKL67RAPCgRX3G0wHiFtv bq2g== X-Gm-Message-State: APjAAAWaI9bUYEI8xmblTPT/rwb0gbu5LK1tPDRkOo+W6nmR+mMchsZO qpcx6rszJ3YmfUxrNYCAi7Bnq+sGlD4= X-Google-Smtp-Source: APXvYqxCMX1IQ56CM4c9FC84mirUAds+HASXn55Th38waHvl7ZdSe+pSLDK8qHVYdvkh9q96uuE0gw== X-Received: by 2002:a63:5212:: with SMTP id g18mr36978278pgb.387.1562178738872; Wed, 03 Jul 2019 11:32:18 -0700 (PDT) Received: from localhost.localdomain ([123.201.36.115]) by smtp.gmail.com with ESMTPSA id 1sm3024927pfe.102.2019.07.03.11.32.16 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 03 Jul 2019 11:32:18 -0700 (PDT) From: Atharva Lele To: buildroot@buildroot.org Date: Thu, 4 Jul 2019 00:01:37 +0530 Message-Id: <20190703183159.3415-5-itsatharva@gmail.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190703183159.3415-1-itsatharva@gmail.com> References: <20190703183159.3415-1-itsatharva@gmail.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v2 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 - 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),