diff options
author | Alassane Yattara <alassane.yattara@savoirfairelinux.com> | 2024-01-04 16:18:18 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-01-04 23:48:29 +0000 |
commit | 831b3d5b2213f99e009cce1524b4363baa00a5fb (patch) | |
tree | 47fa516b54c84b5e9b665a78cf8486a39f1b0065 /bitbake/lib/toaster | |
parent | da7384a8e99ac5e21ad8d5351eef2cac6690f81c (diff) | |
download | poky-831b3d5b2213f99e009cce1524b4363baa00a5fb.tar.gz |
bitbake: toaster/toastergui: Bug-fix verify given layer path only if import/add local layer
(Bitbake rev: 94e88efa9dbefd37f1d48459ade19797b6034b84)
Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster')
-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': { |