Page MenuHomeVyOS Platform

Switch to new syntax for config file component versions
Closed, ResolvedPublicFEATURE REQUEST


The trailing comments in the config file contain the component version information, which is used by migration scripts. The syntax of the comments have several issues, as mentioned here:

The migration script runner rewrite (T1334) put in place the mechanism for using a preferable syntax, which is natively supported by the vyos1x-config, respectively, vyatta-cfg, parsers (commit ea9bee4c9e0a12947027bb83a6bf493cdf1ed1ed in libvyosconfig, before the refactor to vyos1x-config; respectively, commit e4fe8143d9a9d86eafe04fed3cd788659b46f465 in vyatta-cfg).

Current syntax:

New syntax:

Two additions will precede the switch:
(1) the migration runner script will run the VirtualMigrator (which updates syntax) before Migrator; though the switch over can be set globally, this is to avoid the need for preprocessing the syntax in configtree.
(2) remove default syntax target from VirtualMigrator, to allow virtual migration to the old syntax for portability to earlier releases.


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

Event Timeline

jestabro updated the task description. (Show Details)
jestabro updated the task description. (Show Details)
jestabro triaged this task as Normal priority.Feb 12 2020, 7:45 PM
jestabro changed Difficulty level from Unknown (require assessment) to Normal (likely a few hours).

This PR changes the syntax of the trailing version string of the config file (cf. above), as represented during config migration, and the parsing by which configtree splits the config file into the config section proper and the version string.

The version string is written to the config file on two occasions:
(1) During migration, which happens on boot of livecd, load config, or merge config.
(2) On configuration save.

This PR enforces the separation of the two mechanisms, and addresses (1). As the syntax is updated before running any migration scripts (virtual- or meta- migration), there is no issue in ignoring (2) for the moment, and hence retaining the classic syntax on save; this will maintain portability and expected output for now.

N.B. one will see the following: on first boot of livecd or installed image, the config file will have the new syntax, as 'save' has not occurred. As soon as the config is saved, it will have the classic syntax. The choice of syntax written on save is determined by the string 'vintage' (one of ['vyatta', 'vyos']) in python/vyos/

jestabro changed the task status from Open to Needs testing.Feb 20 2020, 8:33 PM
erkin set Issue type to Internal change (not visible to end users).Aug 31 2021, 5:43 PM