Description
ConfigViewInterfaceBase has 31 abstract properties that every platform must implement. Most platforms only implement a fraction — Cisco XR (29%), NXOS (23%), and Arista EOS (13%) raise NotImplementedError for the majority. This forces boilerplate stubs and misleads users into thinking a feature is available when it's not.
Proposed Change
Split into a minimal core interface and optional protocol-based mixins:
Core (required by all platforms):
name, description, enabled, ipv4_interfaces, is_loopback, is_svi, is_subinterface, number, port_number
Optional mixins (implement only if the platform supports them):
BundleViewMixin: bundle_id, bundle_name, bundle_member_interfaces, is_bundle, _bundle_prefix
VlanViewMixin: native_vlan, tagged_vlans, tagged_all, dot1q_mode
NACViewMixin: has_nac, nac_host_mode, nac_mab_first, nac_control_direction_in, nac_max_dot1x_clients, nac_max_mab_clients
PhysicalViewMixin: duplex, speed, poe, module_number
Users can check capability via isinstance(view, VlanViewMixin) rather than catching NotImplementedError.
Current Property Availability
| Platform |
Implemented |
Total |
Coverage |
| HP ProCurve |
28 |
31 |
90% |
| Cisco IOS |
26 |
31 |
84% |
| Cisco XR |
9 |
31 |
29% |
| Cisco NXOS |
7 |
31 |
23% |
| Arista EOS |
4 |
31 |
13% |
Breaking Change
Yes — ConfigViewInterfaceBase changes its interface. Code using isinstance checks or accessing properties that move to mixins would need updating.
Description
ConfigViewInterfaceBasehas 31 abstract properties that every platform must implement. Most platforms only implement a fraction — Cisco XR (29%), NXOS (23%), and Arista EOS (13%) raiseNotImplementedErrorfor the majority. This forces boilerplate stubs and misleads users into thinking a feature is available when it's not.Proposed Change
Split into a minimal core interface and optional protocol-based mixins:
Core (required by all platforms):
name,description,enabled,ipv4_interfaces,is_loopback,is_svi,is_subinterface,number,port_numberOptional mixins (implement only if the platform supports them):
BundleViewMixin:bundle_id,bundle_name,bundle_member_interfaces,is_bundle,_bundle_prefixVlanViewMixin:native_vlan,tagged_vlans,tagged_all,dot1q_modeNACViewMixin:has_nac,nac_host_mode,nac_mab_first,nac_control_direction_in,nac_max_dot1x_clients,nac_max_mab_clientsPhysicalViewMixin:duplex,speed,poe,module_numberUsers can check capability via
isinstance(view, VlanViewMixin)rather than catchingNotImplementedError.Current Property Availability
Breaking Change
Yes —
ConfigViewInterfaceBasechanges its interface. Code usingisinstancechecks or accessing properties that move to mixins would need updating.