From d022a4099c5476b78b2215fcc2f1c06559ceaf09 Mon Sep 17 00:00:00 2001 From: Donatas Abraitis Date: Sat, 20 Jul 2024 03:29:21 +0300 Subject: [PATCH] tools: Do not append an empty list (pim_vrfs) to the config lines If pim_vrfs is empty, we append [] into the lines array, and the reload is broken since it expects only strings, but gets an array inside at the end. ``` Traceback (most recent call last): File "/usr/lib/frr/frr-reload.py", line 2227, in log.debug("New Frr Config\n%s", newconf.get_lines()) File "/usr/lib/frr/frr-reload.py", line 436, in get_lines return "\n".join(self.lines) TypeError: sequence item 45: expected str instance, list found ``` Fixes: 98d47f43fbba4e376c8351c724e8c625799805f7 ("tools: Fix frr-reload to support legacy pim configuration from file") Signed-off-by: Donatas Abraitis --- tools/frr-reload.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/frr-reload.py b/tools/frr-reload.py index 47e3637550..8a39f4204d 100755 --- a/tools/frr-reload.py +++ b/tools/frr-reload.py @@ -400,7 +400,8 @@ class Config(object): self.lines.append(line) - self.lines.append(pim_vrfs) + if len(pim_vrfs) > 0: + self.lines.append(pim_vrfs) self.load_contexts() -- 2.39.5