Page MenuHomeVyOS Platform

Keep track of source of config dict value when merging defaults
Closed, ResolvedPublicENHANCEMENT

Description

The standard workflow in config mode scripts is to (1) obtain the config information in the form of the config dictionary (get_config_dict) (2) merge in any defined default values for those leaf node values not set by config, and pass the resulting dictionary as argument to the next stages (verify; generate; apply).

It is however useful on occasion to be able to check in a later stage (verify) whether a given value had originally been set by the user, or simply merged in by default. Carry over this missing information in the config dict, and add a boolean test 'from_defaults' to check if a given path was originally set by user (False) or only merged in by defaults (True).

Note that this will be implemented for get_config_dict(.., with_defaults=True), which does the merging of defaults automatically, after T5228, as used in T5308.

Details

Version
vyos-1.4
Is it a breaking change?
Perfectly compatible

Event Timeline

jestabro triaged this task as Normal priority.
jestabro created this object in space S1 VyOS Public.

Implementation here:
https://github.com/vyos/vyos-1x/compare/current...jestabro:from-defaults

Requires an adjustment for recursive defaults before PR.

jestabro moved this task from Open to Finished on the VyOS 1.4 Sagitta board.