diff options
| author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-05-12 08:30:35 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-06-02 08:24:02 +0100 |
| commit | 0f2c59367a649de5f57acdccfb4f1fdba9cde730 (patch) | |
| tree | 7a3558a3e08e690fbb0b5bdc4044316f9ab4bbcb /bitbake/lib/bblayers/layerindex.py | |
| parent | ef1df516512587ad415f76a9626620992d660e45 (diff) | |
| download | poky-0f2c59367a649de5f57acdccfb4f1fdba9cde730.tar.gz | |
bitbake: bitbake: Convert to python 3
Various misc changes to convert bitbake to python3 which don't warrant
separation into separate commits.
(Bitbake rev: d0f904d407f57998419bd9c305ce53e5eaa36b24)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bblayers/layerindex.py')
| -rw-r--r-- | bitbake/lib/bblayers/layerindex.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/bitbake/lib/bblayers/layerindex.py b/bitbake/lib/bblayers/layerindex.py index 3c39d8a79e..10ad718eba 100644 --- a/bitbake/lib/bblayers/layerindex.py +++ b/bitbake/lib/bblayers/layerindex.py | |||
| @@ -1,10 +1,10 @@ | |||
| 1 | import argparse | 1 | import argparse |
| 2 | import httplib | 2 | import http.client |
| 3 | import json | 3 | import json |
| 4 | import logging | 4 | import logging |
| 5 | import os | 5 | import os |
| 6 | import subprocess | 6 | import subprocess |
| 7 | import urlparse | 7 | import urllib.parse |
| 8 | 8 | ||
| 9 | from bblayers.action import ActionPlugin | 9 | from bblayers.action import ActionPlugin |
| 10 | 10 | ||
| @@ -24,12 +24,12 @@ class LayerIndexPlugin(ActionPlugin): | |||
| 24 | def get_json_data(self, apiurl): | 24 | def get_json_data(self, apiurl): |
| 25 | proxy_settings = os.environ.get("http_proxy", None) | 25 | proxy_settings = os.environ.get("http_proxy", None) |
| 26 | conn = None | 26 | conn = None |
| 27 | _parsedurl = urlparse.urlparse(apiurl) | 27 | _parsedurl = urllib.parse.urlparse(apiurl) |
| 28 | path = _parsedurl.path | 28 | path = _parsedurl.path |
| 29 | query = _parsedurl.query | 29 | query = _parsedurl.query |
| 30 | 30 | ||
| 31 | def parse_url(url): | 31 | def parse_url(url): |
| 32 | parsedurl = urlparse.urlparse(url) | 32 | parsedurl = urllib.parse.urlparse(url) |
| 33 | if parsedurl.netloc[0] == '[': | 33 | if parsedurl.netloc[0] == '[': |
| 34 | host, port = parsedurl.netloc[1:].split(']', 1) | 34 | host, port = parsedurl.netloc[1:].split(']', 1) |
| 35 | if ':' in port: | 35 | if ':' in port: |
| @@ -46,11 +46,11 @@ class LayerIndexPlugin(ActionPlugin): | |||
| 46 | 46 | ||
| 47 | if proxy_settings is None: | 47 | if proxy_settings is None: |
| 48 | host, port = parse_url(apiurl) | 48 | host, port = parse_url(apiurl) |
| 49 | conn = httplib.HTTPConnection(host, port) | 49 | conn = http.client.HTTPConnection(host, port) |
| 50 | conn.request("GET", path + "?" + query) | 50 | conn.request("GET", path + "?" + query) |
| 51 | else: | 51 | else: |
| 52 | host, port = parse_url(proxy_settings) | 52 | host, port = parse_url(proxy_settings) |
| 53 | conn = httplib.HTTPConnection(host, port) | 53 | conn = http.client.HTTPConnection(host, port) |
| 54 | conn.request("GET", apiurl) | 54 | conn.request("GET", apiurl) |
| 55 | 55 | ||
| 56 | r = conn.getresponse() | 56 | r = conn.getresponse() |
