Page MenuHomeVyOS Platform

Add an option to mangle dict keys to vyos.config.get_config_dict()
Closed, ResolvedPublic

Description

Some template libraries like Jinja2 don't like certain characters in dict keys. Jinja2 hates hyphens for example.

This makes the output of get_config_dict() impossible to use with them. We need a way to mangle keys according to some rules.

vyos.config.get_config_dict(key_mangling=('-', '_'))

Details

Difficulty level
Unknown (require assessment)
Version
-
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Perfectly compatible
Issue type
Internal change (not visible to end users)

Event Timeline

Unknown Object (User) added a subscriber: Unknown Object (User).Jun 18 2020, 7:15 PM

Can I propose this do as default but keep the possibility redefine replace option?

Making it a default can make sense, if everyone agrees.

erkin set Issue type to Internal change (not visible to end users).Aug 30 2021, 5:12 AM
erkin removed a subscriber: Active contributors.