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

Difficulty level
Normal (likely a few hours)
Version
vyos-1.4
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Perfectly compatible
Issue type
Improvement (missing useful functionality)