All of lore.kernel.org
 help / color / mirror / Atom feed
From: Elliot Smith <elliot.smith@intel.com>
To: toaster@yoctoproject.org
Subject: [PATCH] toaster: show https proxy in error output
Date: Thu, 30 Jun 2016 11:21:12 +0100	[thread overview]
Message-ID: <1467282072-10881-1-git-send-email-elliot.smith@intel.com> (raw)

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 <elliot.smith@intel.com>
---
 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



             reply	other threads:[~2016-06-30 10:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-30 10:21 Elliot Smith [this message]
2016-07-05 15:51 ` [PATCH] toaster: show https proxy in error output Michael Wood
  -- strict thread matches above, loose matches on Subject: below --
2016-04-19 12:19 Elliot Smith
2016-05-24 14:40 ` Michael Wood

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1467282072-10881-1-git-send-email-elliot.smith@intel.com \
    --to=elliot.smith@intel.com \
    --cc=toaster@yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.