Page MenuHomeVyOS Platform

get_config_dict() and key_mangling=('-', '_') will alter CLI data for tagNodes
Closed, ResolvedPublicBUG


When using key_mangling=('-', '_') the processor in the background will alter tagnodes and replace any - by _ which will cause faulty behavior as the data becomes invalid!

cpo@LR1.wue3# show system ntp
 server {
 server {
 server {
+server {
+    prefer
>>> from vyos.config import Config
>>> conf = Config()
>>> conf.get_config_dict(['system','ntp'], key_mangling=('-', '_'))
{'ntp': {'server': {'': {}, '': {}, '': {}, '': {'prefer': {}}}}}
>>> conf.get_config_dict(['system','ntp'])
{'ntp': {'server': {'': {}, '': {}, '': {}, '': {'prefer': {}}}}}



Difficulty level
Normal (likely a few hours)
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Internal change (not visible to end users)

Event Timeline

c-po triaged this task as Unbreak Now! priority.
c-po created this task.

I assume this will break 'system static-host-mapping host-name' and other places where tagnodes are used to carry string values as well

It will break everything when in use ;)

erkin set Issue type to Internal change (not visible to end users).Aug 29 2021, 1:46 PM
erkin removed a subscriber: Active contributors.