Skip to contentSkip to conversation

toaster: Fix adding of bitbake variables containing ':'

PATCH New Ed Bartosh 1 participant 1 message Aug 30, 2016

lore
Share & tools
lore

Ed Bartosh

author
#0 lore raw

PATCH 1/1 toaster: Fix adding of bitbake variables containing ':'

From: Alexander Egorenkov <[email protected]>

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]

---
 bitbake/lib/toaster/toastergui/views.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
bitbake/lib/toaster/toastergui/views.py +2 -2
index bd5bf63..febd17f 100755
@@ -2168,7 +2168,7 @@ if True:
             if 'configvarAdd' in request.POST:
                 t=request.POST['configvarAdd'].strip()
                 if ":" in t:
-                    variable, value = t.split(":")
+                    variable, value = t.split(":", 1)
                 else:
                     variable = t
                     value = ""
@@ -2178,7 +2178,7 @@ if True:
             if 'configvarChange' in request.POST:
                 t=request.POST['configvarChange'].strip()
                 if ":" in t:
-                    variable, value = t.split(":")
+                    variable, value = t.split(":", 1)
                 else:
                     variable = t
                     value = ""
Signature · 1 line
2.1.4