The template for the config_db.json currently has the problem of potentially adding INTERFACE: null to the config_db, which ruins all interface configuration. Unfortunately the scoping of jinja2 variables makes it impossible to change a variable value inside of a scope and access the updated value from a different scope (See docs). So I ended up using these complicated chains of filters. Better ideas are welcome.
The template for the config_db.json currently has the problem of potentially adding
INTERFACE: null
to the config_db, which ruins all interface configuration. Unfortunately the scoping of jinja2 variables makes it impossible to change a variable value inside of a scope and access the updated value from a different scope (See docs). So I ended up using these complicated chains of filters. Better ideas are welcome.