From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3995DC47073 for ; Fri, 5 Jan 2024 00:01:02 +0000 (UTC) Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) by mx.groups.io with SMTP id smtpd.web11.10667.1704412852473772487 for ; Thu, 04 Jan 2024 16:00:52 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=IOT1WLt4; spf=pass (domain: linuxfoundation.org, ip: 209.85.128.48, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-40d5ac76667so7807575e9.1 for ; Thu, 04 Jan 2024 16:00:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1704412851; x=1705017651; darn=lists.yoctoproject.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:from:to:cc:subject:date :message-id:reply-to; bh=eCaCuilI2oRz4lKsc/JXGH39oSYLyoooqGvTWe/T/co=; b=IOT1WLt4CrJSAqE5tX+78Bq/AbnFv0en6RN9znnjNemLu3w6slgsNOOvhSMwFSjDf3 4nBlbv3NsbcKjiWSbsRPHLRFEECMPWFjWevvA59inAma0hWPEuIZhf4/QkD3g9wtPHGh IfDBnTry6zI6mhCwPxRp29hfpZbeEBUYzIO7c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704412851; x=1705017651; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=eCaCuilI2oRz4lKsc/JXGH39oSYLyoooqGvTWe/T/co=; b=VQOxTakgG5v6G6tO/fu3K56QIkjv/bisoxwJubUgVtmNEP8v0XMe8AMhB0yjkjSsIi lbS31GBQZabu7aBoyVTRpCrnaDGW8aIEJDrQwR6xCM1GlooAqvzSVDocAKe64/SL9n5V D4I29JcMTHc4h6CuPE5YtwY4iNXAqGba8f5DDeBrWnNt2eyOp37YeiIqPqdZ1yzYQMqF GtQsE5CWiZnn97K0fngCaT0QcxoSF+rTfvlvvlkKay3+92dg3xQMnQnUeMGF23Qcm5en Gvyz7lIEQxuZBpJbps41tkdd//sBZoHr3N3fadYOwUxES/Fll0bLP38IidH+sGfIy5ki Zl0A== X-Gm-Message-State: AOJu0YzYwoz93zdGXgp8461/Ed4shsca5Jw+XvPWHw3mII67ZUJ2xpfy xxlY7ozVMuj/8u281g6HKPgFIU3uactXlA== X-Google-Smtp-Source: AGHT+IHutuoRXGc0u1O9Kr1SbK0qkSHh7mP/eBwLo/CCNDgmw2OHJnK7/MK9Wy+l8MghFbw+Ox3Dqw== X-Received: by 2002:a05:600c:1d1e:b0:40d:9485:b3ea with SMTP id l30-20020a05600c1d1e00b0040d9485b3eamr826278wms.19.1704412850804; Thu, 04 Jan 2024 16:00:50 -0800 (PST) Received: from ?IPv6:2001:8b0:aba:5f3c:8000:8a34:98ad:54c2? ([2001:8b0:aba:5f3c:8000:8a34:98ad:54c2]) by smtp.gmail.com with ESMTPSA id n19-20020a05600c4f9300b0040d8d023760sm7085383wmq.5.2024.01.04.16.00.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jan 2024 16:00:50 -0800 (PST) Message-ID: Subject: Re: [Toaster] [PATCH] toaster/toastergui: Bug-fix verify given layer path only if import/add local layer From: Richard Purdie To: Alassane Yattara , toaster@lists.yoctoproject.org Date: Fri, 05 Jan 2024 00:00:48 +0000 In-Reply-To: <20240104151818.133335-1-alassane.yattara@savoirfairelinux.com> References: <20240104151818.133335-1-alassane.yattara@savoirfairelinux.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.48.1-0ubuntu1 MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 05 Jan 2024 00:01:02 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/toaster/message/6124 On Thu, 2024-01-04 at 16:18 +0100, Alassane Yattara wrote: > Signed-off-by: Alassane Yattara > --- > lib/toaster/toastergui/api.py | 13 ++++++++----- > 1 file changed, 8 insertions(+), 5 deletions(-) >=20 > diff --git a/lib/toaster/toastergui/api.py b/lib/toaster/toastergui/api.p= y > index a06ffc00..e367bd91 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)}) > =20 > - # 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) > =20 > 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") > =20 > return JsonResponse({'error': "ok", > 'imported_layer': { Thanks! I made 4 test runs with this applied and the failure counts reduced significantly, there was only one failure on one build: https://autobuilder.yoctoproject.org/typhoon/#/builders/161/builds/116 I've merged this patch and scheduled a few more test runs. Cheers, Richard