Page MenuHomeVyOS Platform

OSPF: route-map names containing a hypen are not "found"
Closed, ResolvedPublicBUG


The introduction of key_mangling=('-', '_') when working with get_config_dict() caused more harm then good.

The main reason here is that Jinja2 does not support working with the . operator on a dictionary key which contains a hyphen.

Imagine a dictionary:

{'area': {'0': {'network': ['', '']},
          'area-type': {}},
 'auto-cost': {'reference-bandwidth': '100'},
 'interface': {'eth0': {'authentication': {'md5': {'key-id': {'10': {'md5-key': 'vyos'}}}},
                            'dead-interval': '40',
                            'hello-interval': '10',
                            'priority': '1',
                            'retransmit-interval': '5',
                            'transmit-delay': '1',
 'log-adjacency-changes': {'detail': {}},
 'parameters': {'abr-type': 'cisco', 'router-id': ''},
 'passive-interface': ['default'],
 'passive-interface-exclude': ['eth0.201'],
 'redistribute': {},
 'timers': {'throttle': {'spf': {'delay': '200',
                                 'initial-holdtime': '1000',
                                 'max-holdtime': '10000'}}}}

In Jinja2 you can access key like: {{ interface.eth0.priority }} which will give you 1, but you can not use this syntax (.) when accessing keys containing a hyphen, you instead must use: {{ interface.eth0['dead-interval'] }}

Worth noticing:

Also mentioned here:


Difficulty level
Unknown (require assessment)
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)

Event Timeline

c-po changed the task status from Open to In progress.Thu, Apr 8, 11:03 AM
c-po claimed this task.
c-po triaged this task as High priority.
c-po updated the task description. (Show Details)
c-po updated the task description. (Show Details)
c-po moved this task from Need Triage to In Progress on the VyOS 1.4 Sagitta board.