Page MenuHomeVyOS Platform

vyos.vyos: vyos_config match=line ignores double quotes and matches delete paths by prefix
Open, NormalPublic

Description

vyos.vyos.vyos_config with the default match: line has two diff bugs in plugins/cliconf/vyos.py get_diff():

  1. Only single quotes are stripped before comparing candidate and running lines. A task line such as set interfaces ethernet eth0 description "uplink core" never matches the running ... description 'uplink core', so the task reports changed on every run.
  2. delete lines are matched against the running config with re.match(item + r"\b"). \b also matches before /, . or -, so delete ... address 10.0.0.1 matches the running address '10.0.0.1/24' and the module sends a delete for a node that does not exist, which fails the commit.

Fix: strip double quotes as well, and require whitespace or end of line after the deleted path. Also remove the unused diff_config() helper in plugins/modules/vyos_config.py, an old copy of the same logic.

Details

Version
rolling
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Bug (incorrect behavior)