summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlassane Yattara <alassane.yattara@savoirfairelinux.com>2024-01-04 16:18:18 +0100
committerSteve Sakoman <steve@sakoman.com>2024-02-07 04:10:22 -1000
commit12fab85ba186f2a372c40f733b0881f0efc46024 (patch)
tree365f79802e55aee2c4d2b761d49cc7da6e272bf0
parentb22e4f002d3f0bc3cb2aa6fb5249785f5b0d95e6 (diff)
downloadpoky-12fab85ba186f2a372c40f733b0881f0efc46024.tar.gz
bitbake: toaster/toastergui: Bug-fix verify given layer path only if import/add local layer
(Bitbake rev: 7ce4107bf824b3e115b40558336de25f99af31f8) Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Steve Sakoman <steve@sakoman.com>
-rw-r--r--bitbake/lib/toaster/toastergui/api.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/bitbake/lib/toaster/toastergui/api.py b/bitbake/lib/toaster/toastergui/api.py
index a06ffc00dc..e367bd910e 100644
--- a/bitbake/lib/toaster/toastergui/api.py
+++ b/bitbake/lib/toaster/toastergui/api.py
@@ -227,7 +227,7 @@ class XhrSetDefaultImageUrl(View):
227# same logical name 227# same logical name
228# * Each project that uses a layer will have its own 228# * Each project that uses a layer will have its own
229# LayerVersion and Project Layer for it 229# LayerVersion and Project Layer for it
230# * During the Paroject delete process, when the last 230# * During the Project delete process, when the last
231# LayerVersion for a 'local_source_dir' layer is deleted 231# LayerVersion for a 'local_source_dir' layer is deleted
232# then the Layer record is deleted to remove orphans 232# then the Layer record is deleted to remove orphans
233# 233#
@@ -457,15 +457,18 @@ class XhrLayer(View):
457 'layerdetailurl': 457 'layerdetailurl':
458 layer_dep.get_detailspage_url(project.pk)}) 458 layer_dep.get_detailspage_url(project.pk)})
459 459
460 # Scan the layer's content and update components 460 # Only scan_layer_content if layer is local
461 scan_layer_content(layer,layer_version) 461 if layer_data.get('local_source_dir', None):
462 # Scan the layer's content and update components
463 scan_layer_content(layer,layer_version)
462 464
463 except Layer_Version.DoesNotExist: 465 except Layer_Version.DoesNotExist:
464 return error_response("layer-dep-not-found") 466 return error_response("layer-dep-not-found")
465 except Project.DoesNotExist: 467 except Project.DoesNotExist:
466 return error_response("project-not-found") 468 return error_response("project-not-found")
467 except KeyError: 469 except KeyError as e:
468 return error_response("incorrect-parameters") 470 _log("KeyError: %s" % e)
471 return error_response(f"incorrect-parameters")
469 472
470 return JsonResponse({'error': "ok", 473 return JsonResponse({'error': "ok",
471 'imported_layer': { 474 'imported_layer': {