[Toaster] [PATCH] toaster: Fix adding of bitbake variables containing ':'

Barros Pena, Belen belen.barros.pena at intel.com
Tue Aug 23 03:54:21 PDT 2016



On 23/08/2016 10:57, "toaster-bounces at yoctoproject.org on behalf of
Alexander Egorenkov" <toaster-bounces at yoctoproject.org on behalf of
Alexander.Egorenkov at vector.com> wrote:

>This fix is a backport from toaster-next.
>
>Krogoth Toaster is unable to add a variable containing ':'
>and fails with the following error message:
>
>error on request:
>too many values to unpack
>Traceback (most recent call last):
> File "bitbake/lib/toaster/toastergui/views.py", line 2171, in
>xhr_configvaredit
>  variable, value = t.spli(":")
>ValueError: too many values to unpack.
>
>[YOCTO #10170]

This works for me.

Thanks!

Belén

>
>Signed-off-by: Alexander Egorenkov <Alexander.Egorenkov at vector.com>
>---
> bitbake/lib/toaster/toastergui/views.py | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
>diff --git a/bitbake/lib/toaster/toastergui/views.py
>b/bitbake/lib/toaster/toastergui/views.py
>index bd5bf63..2b714dc 100755
>--- a/bitbake/lib/toaster/toastergui/views.py
>+++ b/bitbake/lib/toaster/toastergui/views.py
>@@ -2164,11 +2164,12 @@ if True:
>     def xhr_configvaredit(request, pid):
>         try:
>             prj = Project.objects.get(id = pid)
>+            max_split=1
>             # add conf variables
>             if 'configvarAdd' in request.POST:
>                 t=request.POST['configvarAdd'].strip()
>                 if ":" in t:
>-                    variable, value = t.split(":")
>+                    variable, value = t.split(":", max_split)
>                 else:
>                     variable = t
>                     value = ""
>@@ -2178,7 +2179,7 @@ if True:
>             if 'configvarChange' in request.POST:
>                 t=request.POST['configvarChange'].strip()
>                 if ":" in t:
>-                    variable, value = t.split(":")
>+                    variable, value = t.split(":", max_split)
>                 else:
>                     variable = t
>                     value = ""
>-- 
>2.9.3
>
>-- 
>_______________________________________________
>toaster mailing list
>toaster at yoctoproject.org
>https://lists.yoctoproject.org/listinfo/toaster



More information about the toaster mailing list