All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Clément Péron" <peron.clem@gmail.com>
To: meta-arm@lists.yoctoproject.org
Cc: "Clément Péron" <peron.clem@gmail.com>
Subject: [PATCH 2/2] scripts/runfvp: Fix KeyError exception when there is no FVP_CONSOLE provided
Date: Wed, 29 Mar 2023 14:00:57 +0200	[thread overview]
Message-ID: <20230329120057.58949-2-peron.clem@gmail.com> (raw)
In-Reply-To: <20230329120057.58949-1-peron.clem@gmail.com>

We access the dictionnary element that doesn't exist.

Use the get() method instead that will default the element to None if it
doesn't exist.

Signed-off-by: Clément Péron <peron.clem@gmail.com>
---
 scripts/runfvp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/runfvp b/scripts/runfvp
index c5a74b2f..ee60486c 100755
--- a/scripts/runfvp
+++ b/scripts/runfvp
@@ -55,8 +55,8 @@ async def start_fvp(args, config, extra_args):
 
         if args.console:
             fvp.add_line_callback(lambda line: logger.debug(f"FVP output: {line}"))
-            expected_terminal = config["consoles"]["default"]
-            if not expected_terminal:
+            expected_terminal = config["consoles"].get("default")
+            if expected_terminal is None:
                 logger.error("--console used but FVP_CONSOLE not set in machine configuration")
                 return 1
             telnet = await fvp.create_telnet(expected_terminal)
-- 
2.34.1



  reply	other threads:[~2023-03-29 12:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-29 12:00 [PATCH 1/2] arm/lib: pass the PATH to fvp runner Clément Péron
2023-03-29 12:00 ` Clément Péron [this message]
2023-03-29 15:42   ` [meta-arm] [PATCH 2/2] scripts/runfvp: Fix KeyError exception when there is no FVP_CONSOLE provided Peter Hoyes
2023-03-31  3:01 ` [PATCH 1/2] arm/lib: pass the PATH to fvp runner Jon Mason
2023-03-31 20:11   ` Jon Mason
2023-05-25  0:51 ` Jon Mason

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230329120057.58949-2-peron.clem@gmail.com \
    --to=peron.clem@gmail.com \
    --cc=meta-arm@lists.yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.