diff mbox series

[1/4] bitbake-layers: layerindex-fetch: Fix undefined stderr variable

Message ID 20251212190806.32476-2-osama.abdelkader@gmail.com
State Accepted, archived
Commit 63e7697d712df4a83bba15a5961a768646f3e611
Headers show
Series bitbake-layers: layerindex-fetch: respect --branch for already-configured layers | expand

Commit Message

Osama Abdelkader Dec. 12, 2025, 7:08 p.m. UTC
Fix undefined 'stderr' variable in error handling. The variable should
be 'completed_proc.stderr' to properly display the error message from the git command.

Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com>
---
 lib/bblayers/layerindex.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Paul Barker Dec. 15, 2025, 11:52 a.m. UTC | #1
On Fri, 2025-12-12 at 20:08 +0100, Osama Abdelkader wrote:
> Fix undefined 'stderr' variable in error handling. The variable should
> be 'completed_proc.stderr' to properly display the error message from the git command.
> 
> Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com>
> ---
>  lib/bblayers/layerindex.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/bblayers/layerindex.py b/lib/bblayers/layerindex.py
> index ba91fac669..0ffc95822b 100644
> --- a/lib/bblayers/layerindex.py
> +++ b/lib/bblayers/layerindex.py
> @@ -58,7 +58,7 @@ class LayerIndexPlugin(ActionPlugin):
>              cmd = base_cmd + ['branch']
>              completed_proc = subprocess.run(cmd, text=True, capture_output=True)
>              if completed_proc.returncode:
> -                logger.error("Unable to validate repo %s (%s)" % (repodir, stderr))
> +                logger.error("Unable to validate repo %s (%s)" % (repodir, completed_proc.stderr))
>                  return None, None, None
>              else:
>                  if branch != completed_proc.stdout[2:-1]:

Reviewed-by: Paul Barker <paul@pbarker.dev>

This should be applied for the bitbake stable branches as well as
master.

Best regards,
diff mbox series

Patch

diff --git a/lib/bblayers/layerindex.py b/lib/bblayers/layerindex.py
index ba91fac669..0ffc95822b 100644
--- a/lib/bblayers/layerindex.py
+++ b/lib/bblayers/layerindex.py
@@ -58,7 +58,7 @@  class LayerIndexPlugin(ActionPlugin):
             cmd = base_cmd + ['branch']
             completed_proc = subprocess.run(cmd, text=True, capture_output=True)
             if completed_proc.returncode:
-                logger.error("Unable to validate repo %s (%s)" % (repodir, stderr))
+                logger.error("Unable to validate repo %s (%s)" % (repodir, completed_proc.stderr))
                 return None, None, None
             else:
                 if branch != completed_proc.stdout[2:-1]: