summaryrefslogtreecommitdiffstats
path: root/tools/frr-reload.py
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas@opensourcerouting.org>2024-07-20 02:29:21 +0200
committerDonatas Abraitis <donatas@opensourcerouting.org>2024-07-20 02:29:21 +0200
commitd022a4099c5476b78b2215fcc2f1c06559ceaf09 (patch)
treeaf86684b285d1cd15987cc487a7e56fb09d2b22b /tools/frr-reload.py
parentMerge pull request #16406 from opensourcerouting/fix/remove_deprecation_for_s... (diff)
downloadfrr-d022a4099c5476b78b2215fcc2f1c06559ceaf09.tar.xz
frr-d022a4099c5476b78b2215fcc2f1c06559ceaf09.zip
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 <module> 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 <donatas@opensourcerouting.org>
Diffstat (limited to 'tools/frr-reload.py')
-rwxr-xr-xtools/frr-reload.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/frr-reload.py b/tools/frr-reload.py
index 47e363755..8a39f4204 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()