pierky / arouteserver

A tool to automatically build (and test) feature-rich configurations for BGP route servers.
https://arouteserver.readthedocs.org/
GNU General Public License v3.0
288 stars 46 forks source link

Missing edge case for client with no IP. #87

Closed keatonaglair closed 2 years ago

keatonaglair commented 2 years ago

Configuring a route server and had to comment out certain IPs. After running a sed against my clients.yml I kept getting this traceback. Took me several hours (longer than I'd like to admit) to finally realize that one client had no uncommented IP, one of those that I had to comment out, and thus was defined but with no IP, causing this issue. Below is the traceback that I got.

Note: My arouteserver installation was made in /arouteserver on this route server.


Traceback (most recent call last):
  File "./scripts/arouteserver", line 64, in <module>
    if main():
  File "./scripts/arouteserver", line 53, in main
    return cmd.run()
  File "/arouteserver/pierky/arouteserver/commands/tpl_rendering.py", line 177, in run
    builder = builder_class(**self.cfg_builder_params)
  File "/arouteserver/pierky/arouteserver/builder.py", line 423, in __init__
    general_cfg=self.cfg_general)
  File "/arouteserver/pierky/arouteserver/builder.py", line 106, in _get_cfg
    obj.load(path)
  File "/arouteserver/pierky/arouteserver/config/base.py", line 116, in load
    self.parse()
  File "/arouteserver/pierky/arouteserver/config/clients.py", line 146, in parse
    client_descr = get_client_descr(client)
  File "/arouteserver/pierky/arouteserver/config/clients.py", line 40, in get_client_descr
    client_descr += " " + client["ip"]
TypeError: can only concatenate str (not "NoneType") to str
pierky commented 2 years ago

Hello @keatonaglair,

thanks for reporting this issue, I'm sorry to hear you had to spend bit of time to figure out what the problem was.

I've fixed it in cf8162096f8cf0fcd704ddd43aa26f9dbcf51464, and triggered a new CI/CD pipeline that hopefully should bring us release v1.11.1 in a hour or so. I'll check that everything goes well during the CI/CD process.

Thanks again for the feedback.

pierky commented 2 years ago

v1.11.1 is out on PyPi and DockerHub. Cheers.

keatonaglair commented 2 years ago

Thanks, no worries. At least I was able to figure it out. Thought the least I could do was prevent someone else from wasting as much time as I did.