Page MenuHomeVyOS Platform

vyos_facts: Wrong ansible_net_model / ansible_net_serialnum.
Open, NormalPublicBUG

Description

Model and serial number are misparsed from show version: the model regex (?:HW|Hardware) model:\s*(\S+) keeps only the first word (Standard PC (Q35 + ICH9, 2009) -> Standard); the serial regex (?:HW|Hardware) S/N:\s+(\S+) crosses the newline when the field is empty and returns the next line's first word (Hardware), and cuts a serial number with spaces short. Fix: anchor each field to its own line and allow only horizontal whitespace, e.g. ^(?:HW|Hardware) model:[ \t]*(.*?)[ \t]*$ and ^(?:HW|Hardware) S/N:[ \t]*(.*?)[ \t]*$ with re.M (full model; an empty serial number stays empty).

Details

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