diff options
-rw-r--r-- | bitbake/lib/bb/utils.py | 1 | ||||
-rw-r--r-- | bitbake/lib/toaster/orm/models.py | 16 |
2 files changed, 12 insertions, 5 deletions
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py index 138da44ef1..8f75871c18 100644 --- a/bitbake/lib/bb/utils.py +++ b/bitbake/lib/bb/utils.py | |||
@@ -41,7 +41,6 @@ from subprocess import getstatusoutput | |||
41 | from contextlib import contextmanager | 41 | from contextlib import contextmanager |
42 | from ctypes import cdll | 42 | from ctypes import cdll |
43 | 43 | ||
44 | |||
45 | logger = logging.getLogger("BitBake.Util") | 44 | logger = logging.getLogger("BitBake.Util") |
46 | python_extensions = [e for e, _, _ in imp.get_suffixes()] | 45 | python_extensions = [e for e, _, _ in imp.get_suffixes()] |
47 | 46 | ||
diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py index 88967a23f5..9183b0cd7c 100644 --- a/bitbake/lib/toaster/orm/models.py +++ b/bitbake/lib/toaster/orm/models.py | |||
@@ -1147,18 +1147,26 @@ class LayerIndexLayerSource(LayerSource): | |||
1147 | assert self.apiurl is not None | 1147 | assert self.apiurl is not None |
1148 | from django.db import transaction, connection | 1148 | from django.db import transaction, connection |
1149 | 1149 | ||
1150 | import urllib2, urlparse, json | 1150 | import json |
1151 | import os | 1151 | import os |
1152 | |||
1153 | try: | ||
1154 | from urllib.request import urlopen, URLError | ||
1155 | from urllib.parse import urlparse | ||
1156 | except ImportError: | ||
1157 | from urllib2 import urlopen, URLError | ||
1158 | from urlparse import urlparse | ||
1159 | |||
1152 | proxy_settings = os.environ.get("http_proxy", None) | 1160 | proxy_settings = os.environ.get("http_proxy", None) |
1153 | oe_core_layer = 'openembedded-core' | 1161 | oe_core_layer = 'openembedded-core' |
1154 | 1162 | ||
1155 | def _get_json_response(apiurl = self.apiurl): | 1163 | def _get_json_response(apiurl = self.apiurl): |
1156 | _parsedurl = urlparse.urlparse(apiurl) | 1164 | _parsedurl = urlparse(apiurl) |
1157 | path = _parsedurl.path | 1165 | path = _parsedurl.path |
1158 | 1166 | ||
1159 | try: | 1167 | try: |
1160 | res = urllib2.urlopen(apiurl) | 1168 | res = urlopen(apiurl) |
1161 | except urllib2.URLError as e: | 1169 | except URLError as e: |
1162 | raise Exception("Failed to read %s: %s" % (path, e.reason)) | 1170 | raise Exception("Failed to read %s: %s" % (path, e.reason)) |
1163 | 1171 | ||
1164 | return json.loads(res.read()) | 1172 | return json.loads(res.read()) |