diff options
author | Kuldeep Kashyap <kashyapk@vmware.com> | 2022-03-17 09:28:29 +0100 |
---|---|---|
committer | Kuldeep Kashyap <kashyapk@vmware.com> | 2022-03-17 12:59:43 +0100 |
commit | 77e578c90e32151603850c83082fb4e7b2875f60 (patch) | |
tree | 7b483932567cb7c8ce13a762c3ff064d9e84f37a /tests | |
parent | Merge pull request #10813 from opensourcerouting/fix/include_prune_stats_for_... (diff) | |
download | frr-77e578c90e32151603850c83082fb4e7b2875f60.tar.xz frr-77e578c90e32151603850c83082fb4e7b2875f60.zip |
tests: Fix topotests crash when KeyError found
1. Handle KeyError
2. logger object is defined in main function and its not not accessible
in other functions so defined it in local functions.
Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/topotests/lib/micronet_cli.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/topotests/lib/micronet_cli.py b/tests/topotests/lib/micronet_cli.py index 4292f47ce..ef804f6dc 100644 --- a/tests/topotests/lib/micronet_cli.py +++ b/tests/topotests/lib/micronet_cli.py @@ -110,7 +110,7 @@ def doline(unet, line, writef): args = oargs.split() if not args or (len(args) == 1 and args[0] == "*"): args = sorted(unet.hosts.keys()) - hosts = [unet.hosts[x] for x in args] + hosts = [unet.hosts[x] for x in args if x in unet.hosts] for host in hosts: if cmd == "t" or cmd == "term": host.run_in_window("bash", title="sh-%s" % host) @@ -250,6 +250,8 @@ def cli( prompt=None, background=True, ): + logger = logging.getLogger("cli-client") + if prompt is None: prompt = "unet> " |