From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 4138EE00BC2; Tue, 24 May 2016 07:40:34 -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.220.48 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-pa0-f48.google.com (mail-pa0-f48.google.com [209.85.220.48]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id A0AA9E00B5F for ; Tue, 24 May 2016 07:40:32 -0700 (PDT) Received: by mail-pa0-f48.google.com with SMTP id bt5so7329562pac.3 for ; Tue, 24 May 2016 07:40:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=2x9MPRcpFcvUk7LaJB7YbQJmnRrReBqVAMTgPrTD6Gw=; b=XDCV89iyaPuIWrqJtTzMVrgf7u+ILtiPcyuaHIBFJPh8XVnwYI2fUmw6eZlcNuowbO HbrZpuCs8CMqPpV+hIAWAgKFC/XR/lc2lwj7w6KjRlqOkTXZ13vn0uz/lfQLFSQXuVwO ecVgEHxdYHXu29kiIEe/EQtkyLmDYYqKeHXTLr4YmqBpxkCeL1wzqE6oiQsJNJzPBzYT Dap/PK/6s02aqeKXjGLBNGXgnlKtZ4KT+bwz4pRhrLn9q8y8UNmtrnmAqpw75XAXVIkL JK325+HVznHM+ORXyWFdWsGomSk27CAUzRqmCCy6B78vIc7O5f9/1lQ5I6a5UAJlNQxJ ydXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=2x9MPRcpFcvUk7LaJB7YbQJmnRrReBqVAMTgPrTD6Gw=; b=TTOH+m6kb6hl2YfY8AWdkiGRaycY2KxAw9UjtM6im6lozmNZKBwe+oL9ilPeHaL455 26EfhmSxpNeQ1A/XNcfbjWWgopHlnj+CySD6fQDs/0fVAYiTCsVAl3cEb3Q1ijxjzP1q 0ybfLTwf4cHiy1+4wID9R0pP/+U0WkFmtXp2xc/uvwaipayTZCUT+hVVehTuFUJv+1jH n4qr8uCLrfgCdoA0zz79GA89RqGVxeqPeq2dLiziO3VdRYrbPp2jYablubV2hsRULrl0 CBH+PMeVWZzbypUBznvh0KUiKiCjaroZcyNJNPENvU1t7l/gVflXwz6Pj1DLgLouA9AX BsIg== X-Gm-Message-State: ALyK8tIfmQJM5q5Eq/CfZ8KWnH9yxS1PzuZZI4YOuaIId6jbIRbAD8M3qx326d0yRSBmB4b4 X-Received: by 10.66.21.102 with SMTP id u6mr7434049pae.118.1464100831763; Tue, 24 May 2016 07:40:31 -0700 (PDT) Received: from [192.168.0.78] (host31-48-249-108.range31-48.btcentralplus.com. [31.48.249.108]) by smtp.googlemail.com with ESMTPSA id 141sm17864957pfx.68.2016.05.24.07.40.30 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 24 May 2016 07:40:31 -0700 (PDT) To: toaster@yoctoproject.org, elliot Smith References: <1461068366-24796-1-git-send-email-elliot.smith@intel.com> From: Michael Wood Message-ID: <574467DB.3080508@intel.com> Date: Tue, 24 May 2016 15:40:27 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 MIME-Version: 1.0 In-Reply-To: <1461068366-24796-1-git-send-email-elliot.smith@intel.com> Subject: Re: [PATCH] toaster: show https proxy in error output 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: Tue, 24 May 2016 14:40:34 -0000 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit On 19/04/16 13:19, Elliot Smith wrote: > urllib2 automatically uses any http_proxy and https_proxy > settings from the environment. Now that the layer index is > available over https, there is a possibility that a user > may experience an error while fetching layer index. In this > situation, show the https_proxy setting as well as the > http_proxy setting in the error. > > [YOCTO #9439] > > Signed-off-by: Elliot Smith > --- > bitbake/lib/toaster/orm/models.py | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py > index 68c3072..90e3f6a 100644 > --- a/bitbake/lib/toaster/orm/models.py > +++ b/bitbake/lib/toaster/orm/models.py > @@ -1096,7 +1096,10 @@ class LayerIndexLayerSource(LayerSource): > > import urllib2, urlparse, json > import os > - proxy_settings = os.environ.get("http_proxy", None) > + proxy_settings = ( > + os.environ.get("http_proxy", None), > + os.environ.get("https_proxy", None) You don't need to specify None as the default value to return if there is no value for those keys as this is already the default > + ) > oe_core_layer = 'openembedded-core' > > def _get_json_response(apiurl = self.apiurl): > @@ -1116,7 +1119,7 @@ class LayerIndexLayerSource(LayerSource): > except Exception as e: > import traceback > if proxy_settings is not None: proxy_settings will always be True as it can be an tuple with 2x "None" in it, maybe use "if None not in proxy_settings" > - logger.info("EE: Using proxy %s" % proxy_settings) > + logger.info("EE: Using HTTP proxy %s and HTTPS proxy %s" % proxy_settings) > logger.warning("EE: could not connect to %s, skipping update: %s\n%s" % (self.apiurl, e, traceback.format_exc(e))) > return >