From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id B151FE00E6E; Thu, 30 Jun 2016 03:21:28 -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=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no * trust * [23.83.214.10 listed in list.dnswl.org] Received: from barb.maple.relay.mailchannels.net (barb.maple.relay.mailchannels.net [23.83.214.10]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 64D9BE00D53 for ; Thu, 30 Jun 2016 03:21:23 -0700 (PDT) X-Sender-Id: wwwh|x-authuser|elliot@townx.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id D78ABA13A1; Thu, 30 Jun 2016 10:21:18 +0000 (UTC) Received: from uscentral428.accountservergroup.com (ip-10-42-131-234.us-west-2.compute.internal [10.42.131.234]) by relay.mailchannels.net (Postfix) with ESMTPA id 53DC8A0D18; Thu, 30 Jun 2016 10:21:18 +0000 (UTC) X-Sender-Id: wwwh|x-authuser|elliot@townx.org Received: from uscentral428.accountservergroup.com (uscentral428.accountservergroup.com [10.91.5.35]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.6.15); Thu, 30 Jun 2016 10:21:18 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: wwwh|x-authuser|elliot@townx.org X-MailChannels-Auth-Id: wwwh X-MC-Loop-Signature: 1467282078583:250264207 X-MC-Ingress-Time: 1467282078583 Received: from [176.251.41.101] (port=50280 helo=localhost.localdomain) by uscentral428.accountservergroup.com with esmtpa (Exim 4.87) (envelope-from ) id 1bIZ8T-0002pM-3j; Thu, 30 Jun 2016 06:23:53 -0400 From: Elliot Smith To: toaster@yoctoproject.org Date: Thu, 30 Jun 2016 11:21:12 +0100 Message-Id: <1467282072-10881-1-git-send-email-elliot.smith@intel.com> X-Mailer: git-send-email 2.7.4 X-AuthUser: elliot@townx.org Subject: [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: Thu, 30 Jun 2016 10:21:28 -0000 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 the layer index via HTTPS. 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 | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py index 61737c7..8f5e0f5 100644 --- a/bitbake/lib/toaster/orm/models.py +++ b/bitbake/lib/toaster/orm/models.py @@ -1196,7 +1196,11 @@ class LayerIndexLayerSource(LayerSource): from urllib2 import urlopen, URLError from urlparse import urlparse - proxy_settings = os.environ.get("http_proxy", None) + proxy_settings = ( + os.environ.get("http_proxy"), + os.environ.get("https_proxy") + ) + oe_core_layer = 'openembedded-core' def _get_json_response(apiurl = self.apiurl): @@ -1215,8 +1219,7 @@ class LayerIndexLayerSource(LayerSource): apilinks = _get_json_response() except Exception as e: import traceback - if proxy_settings is not None: - 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())) return -- 2.7.4