Page MenuHomeVyOS Platform

Exclude tag node values from key mangling
Closed, ResolvedPublic

Description

As discussed in T3250, key_mangling of tag node values is a problem: since key_mangling is globally applied, it will not preserve the form of values/names containing hyphens, causing an inability to recognize or evaluate said value. For example, in the case of T3250, local usernames containing hyphens will no longer be recognized by a pppoe-server.

Consequently, tag node values should be excluded from key mangling.

Note that, as discussed in that task, key_mangling will eventually be phased out; until then, workarounds such as this will be needed.

Details

Difficulty level
Unknown (require assessment)
Version
vyos-1.4
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)

Related Objects

Event Timeline

jestabro changed the task status from Open to Needs testing.Apr 16 2021, 9:11 PM
jestabro triaged this task as High priority.
jestabro created this task.
jestabro created this object in space S1 VyOS Public.

PR: https://github.com/vyos/vyos-1x/pull/811

Example:

>>> from vyos.config import Config
>>> import pprint
>>> conf = Config()
>>> # no mangling
... tmp = conf.get_config_dict(['simple'], get_first_key=True)
>>> pprint.pprint(tmp)
{'some-tag-node': {'some-foo': {'just-a-node': {'single-value': 'bar'}},
                   'some-other-foo': {'just-a-node': {'multiple-value': ['first',
                                                                         'second']}}}}
>>> # standard mangling
... tmp = conf.get_config_dict(['simple'], get_first_key=True, key_mangling=('-', '_'))
>>> pprint.pprint(tmp)
{'some_tag_node': {'some_foo': {'just_a_node': {'single_value': 'bar'}},
                   'some_other_foo': {'just_a_node': {'multiple_value': ['first',
                                                                         'second']}}}}
>>> # mangling with no_tag_node_value_mangle=True
... tmp = conf.get_config_dict(['simple'], get_first_key=True, key_mangling=('-', '_'), no_tag_node_value_mangle=True)
>>> pprint.pprint(tmp)
{'some_tag_node': {'some-foo': {'just_a_node': {'single_value': 'bar'}},
                   'some-other-foo': {'just_a_node': {'multiple_value': ['first',
                                                                         'second']}}}}
>>>
jestabro changed the task status from Needs testing to Backport candidate.Apr 17 2021, 12:09 AM
jestabro moved this task from Need Triage to Finished on the VyOS 1.4 Sagitta board.
jestabro moved this task from Need Triage to Finished on the VyOS 1.3 Equuleus board.
SrividyaA set Issue type to Internal change (not visible to end users).Aug 31 2021, 5:23 PM