import_layers: fix URL construction

If you specified only the layer index URL and not the full API URL i.e.
https://layers.openembedded.org then we put an extra slash in the URL
which resulted in the request being redirected to the main page which
breaks the request.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
This commit is contained in:
Paul Eggleton 2019-01-25 16:16:11 +13:00
parent b5892b0fdb
commit e033154f4f

View File

@ -73,7 +73,7 @@ def main():
if not layerindex_url.endswith('/'): if not layerindex_url.endswith('/'):
layerindex_url += '/' layerindex_url += '/'
if not '/layerindex/api/' in layerindex_url: if not '/layerindex/api/' in layerindex_url:
layerindex_url += '/layerindex/api/' layerindex_url += 'layerindex/api/'
rq = urllib.request.Request(layerindex_url) rq = urllib.request.Request(layerindex_url)
data = urllib.request.urlopen(rq).read() data = urllib.request.urlopen(rq).read()