Просмотр исходного кода

checklayer: Skip layers without a collection

As in other places in the file, skip layers that don't define a
collection when searching for a layer to resolve a dependency. Fixes
KeyError exceptions when attempting to access the layer collections
later

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 26090a2861ebe21224aaf89d7be0c0a89ca58e48)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Joshua Watt 4 лет назад
Родитель
Сommit
ae65adf471
1 измененных файлов с 3 добавлено и 0 удалено
  1. 3 0
      scripts/lib/checklayer/__init__.py

+ 3 - 0
scripts/lib/checklayer/__init__.py

@@ -143,6 +143,9 @@ def detect_layers(layer_directories, no_auto):
 
 def _find_layer_depends(depend, layers):
     for layer in layers:
+        if 'collections' not in layer:
+            continue
+
         for collection in layer['collections']:
             if depend == collection:
                 return layer