diff options
| author | Donatas Abraitis <donatas@opensourcerouting.org> | 2024-07-20 03:29:21 +0300 | 
|---|---|---|
| committer | Donatas Abraitis <donatas@opensourcerouting.org> | 2024-07-20 03:29:21 +0300 | 
| commit | d022a4099c5476b78b2215fcc2f1c06559ceaf09 (patch) | |
| tree | af86684b285d1cd15987cc487a7e56fb09d2b22b /tools | |
| parent | 7aeb51e1944efcc643a513cd08ca0ec1c12d83d9 (diff) | |
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')
| -rwxr-xr-x | tools/frr-reload.py | 3 | 
1 files changed, 2 insertions, 1 deletions
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()  | 
