Files
arista-evpn-vxlan-clab/transforms/templates/vxlan_yang.j2
Damien a415de85bd fix: use Jinja2 none instead of null and add defensive checks for optional relationships (#20)
Replace all `null` literals with `none` (valid Jinja2/Python) in all three
templates. Add explicit `is defined and is not none and .node is not none`
guards before accessing nested nodes on optional GraphQL relationships, to
avoid `Undefined is not JSON serializable` errors at render time.

Also add `| default(none)` on optional scalar attributes (speed, mode,
lacp_mode, mlag_id, mtu, description, virtual_router_address,
route_distinguisher, learn_restrict, vlan_type, trunk_groups) so that
Infrahub `Undefined` values from unset optional fields are safely coerced
to JSON null rather than crashing tojson serialization.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-28 17:41:19 +01:00

3.3 KiB