Open Southparkfan opened 10 months ago
Nice find :) The current implementation of the config validation leaves a lot to be desired. I once started an effort to refactor this using Pydantic, but I didn't finish it.
Please raise a PR and I'll check and merge it.
... and now I understand what's wrong here: https://en.wikipedia.org/wiki/Sexagesimal#YAML
42:42:42:42:09:01
will be parsed as (((((42*60)+42)*60+42)*60+42)*60+9)*60+1
(= 33212743741).
I have changed the validation logic and added tests for MAC addresses on my laptop, but if we can switch to YAML 1.2, which does not contain support for sexagesimal numbers, we don't need to tell users to wrap certain MAC addresses (i.e. where every two hexadecimals are in the range of 0.0-5.9) between quotes. If I'm correct, pyyaml doesn't support 1.2 yet, though :(.
If you supply an invalid MAC address to an interface, vnet-manager should complain to you in clear words:
Instead, a TypeError is thrown, which is not caught by the validation code:
Quick fix:
One of the offending line was
mac: 42:42:42:42:00:01
. Wrapping the MAC address in single quotes resolved the issue.