Page MenuHomeVyOS Platform

Comparing old and new configurations in scripts (daemon reloads and restarts)
Open, LowPublic

Description

As described in the developer docs:

The apply() function applies the generated configuration to the live system. It should use non-disruptive reload whenever possible. It may execute disruptive operations such as daemon process restart if a particular component does not support non-disruptive reload, or when the expected service degradation is minimal (for example, in case of auxiliary services such as LLDPd). In case of high impact services such as VPN daemon and routing protocols, when non-disruptive reload is supported for some but not all types of configuration changes, scripts authors should make effort to determine if a configuration change can be done in a non-disruptive way and only resort to disruptive restart if it cannot be avoided.

As an example, the old code held the old and new configs and compared them: example
If they were different, it ran a function of the config script isRestartNeeded($oconfig) that had a list of which options required a daemon restart.

Since the rewrite to python the scripts are missing this logic, which means a simple change of the description will also restart the daemon unnecessarily.

There are other use cases in which a list of options that require just a reload (SIGHUP) rather than complete restart would be very useful.

My question is: is comparing the old and new configs possible with the new python libraries?

Details

Difficulty level
Unknown (require assessment)
Version
-
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Behavior change
Issue type
Feature (new functionality)