diff options
author | David Reyna <David.Reyna@windriver.com> | 2018-10-03 23:10:51 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-10-04 14:33:53 +0100 |
commit | b310031972a53d0881a87a627f07bdcf7d9c6b79 (patch) | |
tree | 6454223d05c98930eb02da05e3a0e9bdbd8ec180 /lib/toaster/toastergui/api.py | |
parent | abccd40536b366a418802c5ba8427454c2e3bb2c (diff) | |
download | bitbake-b310031972a53d0881a87a627f07bdcf7d9c6b79.tar.gz |
toaster: custom image enable layer add, protect pre-cloned layers
When creating custom image recipes, the layer add for new layers
needs missing xhrLayerUrl data. Also, code is needed to check
and inform user if the newly added layer has not been cloned yet,
and provide helpful error message instead of the current frozen
dialog.
[YOCTO #12887]
Signed-off-by: David Reyna <David.Reyna@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/toaster/toastergui/api.py')
-rw-r--r-- | lib/toaster/toastergui/api.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/toaster/toastergui/api.py b/lib/toaster/toastergui/api.py index 1bec56d46..564d595a1 100644 --- a/lib/toaster/toastergui/api.py +++ b/lib/toaster/toastergui/api.py @@ -677,7 +677,13 @@ class XhrCustomRecipe(View): recipe_path = os.path.join(layerpath, "recipes", "%s.bb" % recipe.name) with open(recipe_path, "w") as recipef: - recipef.write(recipe.generate_recipe_file_contents()) + content = recipe.generate_recipe_file_contents() + if not content: + # Delete this incomplete image recipe object + recipe.delete() + return error_response("recipe-parent-not-exist") + else: + recipef.write(recipe.generate_recipe_file_contents()) return JsonResponse( {"error": "ok", |