While working on T2653 and transforming the MACsec interface into a get_config_dict() approach it was noticed that the default dictionary does not obey the given XML levels.
We have a default priority for the MACsec key agreement protocol of 255, when adding this into the XML and querying the result the level is not taken into account
diff --git c/interface-definitions/interfaces-macsec.xml.in i/interface-definitions/interfaces-macsec.xml.in index 36605ab5..dfef387d 100644 --- c/interface-definitions/interfaces-macsec.xml.in +++ i/interface-definitions/interfaces-macsec.xml.in @@ -83,6 +83,7 @@ <validator name="numeric" argument="--range 0-255" /> </constraint> </properties> + <defaultValue>255</defaultValue> </leafNode> </children> </node>
>>> from vyos.xml import defaults >>> from pprint import pprint >>> base = ['interfaces', 'macsec'] >>> pprint(defaults(base)) {'security_mka_priority': '255'}
I'd rather expect the following dictionary representing the same level as get_config_dict():
{'security': {'mka': {'priority': '255'}}}