aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlassane Yattara <alassane.yattara@savoirfairelinux.com>2024-01-04 16:18:18 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-02-06 10:10:23 +0000
commit380a9ac97de5774378ded5e37d40b79b96761a0c (patch)
tree260484486d79fed3189a047f1f66484f4e42a740
parent52226a7244968c8dad6f4ee9ccec57ac1979217a (diff)
downloadbitbake-380a9ac97de5774378ded5e37d40b79b96761a0c.tar.gz
toaster/toastergui: Bug-fix verify given layer path only if import/add local layeryocto-4.3.4yocto-4.3.32023-10.4-nanbield2023-10.3-nanbield2.6.42.6.32.6
Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--lib/toaster/toastergui/api.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/toaster/toastergui/api.py b/lib/toaster/toastergui/api.py
index a06ffc00d..e367bd910 100644
--- a/lib/toaster/toastergui/api.py
+++ b/lib/toaster/toastergui/api.py
@@ -227,7 +227,7 @@ class XhrSetDefaultImageUrl(View):
# same logical name
# * Each project that uses a layer will have its own
# LayerVersion and Project Layer for it
-# * During the Paroject delete process, when the last
+# * During the Project delete process, when the last
# LayerVersion for a 'local_source_dir' layer is deleted
# then the Layer record is deleted to remove orphans
#
@@ -457,15 +457,18 @@ class XhrLayer(View):
'layerdetailurl':
layer_dep.get_detailspage_url(project.pk)})
- # Scan the layer's content and update components
- scan_layer_content(layer,layer_version)
+ # Only scan_layer_content if layer is local
+ if layer_data.get('local_source_dir', None):
+ # Scan the layer's content and update components
+ scan_layer_content(layer,layer_version)
except Layer_Version.DoesNotExist:
return error_response("layer-dep-not-found")
except Project.DoesNotExist:
return error_response("project-not-found")
- except KeyError:
- return error_response("incorrect-parameters")
+ except KeyError as e:
+ _log("KeyError: %s" % e)
+ return error_response(f"incorrect-parameters")
return JsonResponse({'error': "ok",
'imported_layer': {