kontron / python-ipmi

A pure python IPMI library
GNU Lesser General Public License v2.1
185 stars 74 forks source link

lan: return vlan id = 0 if vlan is deactivated #162

Closed canteuni closed 9 months ago

canteuni commented 9 months ago

There is a possibility where the BMC can have the vlan tagging option disabled, but it still has a vlan ID stored in its memory. In that case, a call to get_lan_config_param to know the vlan ID will return the vlan ID of the BMC, but the caller will have no information about whether the vlan is actually enable or not.

To avoid this confusing behavior, I choose to return vlan ID = 0 as a "convention" when the vlan is disabled, but this can be debated obviously.

coveralls commented 9 months ago

Coverage Status

coverage: 69.38% (+0.009%) from 69.371% when pulling d8d40c7e6efd5434215c8c3b52de04031a6413b7 on canteuni:vlan_0_if_vlan_deactivated into a85599c0a230a7488b0f512c4838f214e968e37e on kontron:master.

hthiery commented 9 months ago

Please add a testcase for that .. otherwise looks good to me

canteuni commented 9 months ago

Yes sorry forgot to commit it :upside_down_face: