diff options
Diffstat (limited to 'poky/bitbake/lib/layerindexlib')
-rw-r--r-- | poky/bitbake/lib/layerindexlib/__init__.py | 15 | ||||
-rw-r--r-- | poky/bitbake/lib/layerindexlib/cooker.py | 7 | ||||
-rw-r--r-- | poky/bitbake/lib/layerindexlib/restapi.py | 6 | ||||
-rw-r--r-- | poky/bitbake/lib/layerindexlib/tests/restapi.py | 2 |
4 files changed, 18 insertions, 12 deletions
diff --git a/poky/bitbake/lib/layerindexlib/__init__.py b/poky/bitbake/lib/layerindexlib/__init__.py index 77196b408f..45157b6681 100644 --- a/poky/bitbake/lib/layerindexlib/__init__.py +++ b/poky/bitbake/lib/layerindexlib/__init__.py @@ -7,6 +7,7 @@ import datetime import logging import imp +import os from collections import OrderedDict from layerindexlib.plugin import LayerIndexPluginUrlError @@ -70,7 +71,7 @@ class LayerIndex(): if self.__class__ != newIndex.__class__ or \ other.__class__ != newIndex.__class__: - raise TypeException("Can not add different types.") + raise TypeError("Can not add different types.") for indexEnt in self.indexes: newIndex.indexes.append(indexEnt) @@ -266,8 +267,8 @@ will write out the individual elements split by layer and related components. logger.debug(1, "Store not implemented in %s" % plugin.type) pass else: - logger.debug(1, "No plugins support %s" % url) - raise LayerIndexException("No plugins support %s" % url) + logger.debug(1, "No plugins support %s" % indexURI) + raise LayerIndexException("No plugins support %s" % indexURI) def is_empty(self): @@ -657,7 +658,7 @@ class LayerIndexObj(): if obj.id in self._index[indexname]: if self._index[indexname][obj.id] == obj: continue - raise LayerIndexError('Conflict adding object %s(%s) to index' % (indexname, obj.id)) + raise LayerIndexException('Conflict adding object %s(%s) to index' % (indexname, obj.id)) self._index[indexname][obj.id] = obj def add_raw_element(self, indexname, objtype, rawobjs): @@ -842,11 +843,11 @@ class LayerIndexObj(): def _resolve_dependencies(layerbranches, ignores, dependencies, invalid): for layerbranch in layerbranches: - if ignores and layerBranch.layer.name in ignores: + if ignores and layerbranch.layer.name in ignores: continue - for layerdependency in layerbranch.index.layerDependencies_layerBranchId[layerBranch.id]: - deplayerbranch = layerDependency.dependency_layerBranch + for layerdependency in layerbranch.index.layerDependencies_layerBranchId[layerbranch.id]: + deplayerbranch = layerdependency.dependency_layerBranch if ignores and deplayerbranch.layer.name in ignores: continue diff --git a/poky/bitbake/lib/layerindexlib/cooker.py b/poky/bitbake/lib/layerindexlib/cooker.py index 65b23d087f..21ec438a22 100644 --- a/poky/bitbake/lib/layerindexlib/cooker.py +++ b/poky/bitbake/lib/layerindexlib/cooker.py @@ -4,6 +4,7 @@ # import logging +import os from collections import defaultdict @@ -73,7 +74,7 @@ class CookerPlugin(layerindexlib.plugin.IndexPlugin): d = self.layerindex.data if not branches: - raise LayerIndexFetchError("No branches specified for _load_bblayers!") + raise layerindexlib.LayerIndexFetchError("No branches specified for _load_bblayers!") index = layerindexlib.LayerIndexObj() @@ -202,7 +203,7 @@ class CookerPlugin(layerindexlib.plugin.IndexPlugin): try: depDict = bb.utils.explode_dep_versions2(deps) except bb.utils.VersionStringException as vse: - bb.fatal('Error parsing LAYERDEPENDS_%s: %s' % (c, str(vse))) + bb.fatal('Error parsing LAYERDEPENDS_%s: %s' % (collection, str(vse))) for dep, oplist in list(depDict.items()): # We need to search ourselves, so use the _ version... @@ -268,7 +269,7 @@ class CookerPlugin(layerindexlib.plugin.IndexPlugin): layer = bb.utils.get_file_layer(realfn[0], self.config_data) - depBranchId = collection_layerbranch[layer] + depBranchId = collection[layer] recipeId += 1 recipe = layerindexlib.Recipe(index, None) diff --git a/poky/bitbake/lib/layerindexlib/restapi.py b/poky/bitbake/lib/layerindexlib/restapi.py index 21fd144143..7023f42f20 100644 --- a/poky/bitbake/lib/layerindexlib/restapi.py +++ b/poky/bitbake/lib/layerindexlib/restapi.py @@ -5,9 +5,13 @@ import logging import json +import os + from urllib.parse import unquote from urllib.parse import urlparse +import bb + import layerindexlib import layerindexlib.plugin @@ -163,7 +167,7 @@ class RestApiPlugin(layerindexlib.plugin.IndexPlugin): parsed = _get_json_response(apiurl=up_stripped.geturl(), username=username, password=password, retry=False) logger.debug(1, "%s: retry successful.") else: - raise LayerIndexFetchError('%s: Connection reset by peer. Is there a firewall blocking your connection?' % apiurl) + raise layerindexlib.LayerIndexFetchError('%s: Connection reset by peer. Is there a firewall blocking your connection?' % apiurl) return parsed diff --git a/poky/bitbake/lib/layerindexlib/tests/restapi.py b/poky/bitbake/lib/layerindexlib/tests/restapi.py index e5ccafe5c9..4646d01f9f 100644 --- a/poky/bitbake/lib/layerindexlib/tests/restapi.py +++ b/poky/bitbake/lib/layerindexlib/tests/restapi.py @@ -112,7 +112,7 @@ class LayerIndexWebRestApiTest(LayersTest): break else: self.logger.debug(1, "meta-python was not found") - self.assetTrue(False) + raise self.failureException # Only check the first element... break |