From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 2A55EE00E47; Tue, 23 Aug 2016 04:06:41 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high * trust * [192.55.52.93 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id EB40FE00CEF for ; Tue, 23 Aug 2016 04:06:35 -0700 (PDT) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga102.fm.intel.com with ESMTP; 23 Aug 2016 04:06:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,565,1464678000"; d="scan'208";a="839488" Received: from linux.intel.com ([10.54.29.200]) by fmsmga005.fm.intel.com with ESMTP; 23 Aug 2016 04:06:35 -0700 Received: from linux.intel.com (vmed.fi.intel.com [10.237.72.68]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by linux.intel.com (Postfix) with ESMTP id 4F1716A4006; Tue, 23 Aug 2016 04:06:16 -0700 (PDT) Date: Tue, 23 Aug 2016 14:06:26 +0300 From: Ed Bartosh To: Alexander Egorenkov Message-ID: <20160823110625.GA864@linux.intel.com> References: <20160823095750.41216-1-Alexander.Egorenkov@vector.com> MIME-Version: 1.0 In-Reply-To: <20160823095750.41216-1-Alexander.Egorenkov@vector.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.5.21 (2010-09-15) Cc: toaster@yoctoproject.org Subject: Re: [PATCH] toaster: Fix adding of bitbake variables containing ':' X-BeenThere: toaster@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: ed.bartosh@linux.intel.com List-Id: Web based interface for BitBake List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Aug 2016 11:06:41 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Aug 23, 2016 at 11:57:50AM +0200, Alexander Egorenkov 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] > > Signed-off-by: Alexander Egorenkov > --- > 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 = "" Would it be better to use 'variable, value = t.split(":", 1)' in both lines, i.e. without adding max_split variable? It would be more readable in my opinion. -- Regards, Ed