diff options
author | Alassane Yattara <alassane.yattara@savoirfairelinux.com> | 2024-01-04 16:18:18 +0100 |
---|---|---|
committer | Steve Sakoman <steve@sakoman.com> | 2024-02-07 04:00:02 -1000 |
commit | 94b73c33d5ca2e8d09562c93b7e2f3501a27e38f (patch) | |
tree | 1d8a9bce15d6aeb673b3a4916c1adff2fd6921f4 | |
parent | cf9b37dfd05672f2df77686029fdfbf218fc71e4 (diff) | |
download | poky-94b73c33d5ca2e8d09562c93b7e2f3501a27e38f.tar.gz |
bitbake: toaster/toastergui: Bug-fix verify given layer path only if import/add local layer
(Bitbake rev: 380a9ac97de5774378ded5e37d40b79b96761a0c)
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.py | 13 |
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': { |