Skip to content

Commit 54cab7a

Browse files
authored
models: OpticsPhysicalChannelsDict value should be a list
In all of the base [1], drivers and test fixture implementations of `NetworkDriver.get_optics()`, the return value `.[intf_name]["physical_channels"]["channels"]` is a list of dictionaries (specifically, a list of `OpticsPerChannelDict`). However, in the current model, it is listed as a single `OpticsPerChannelDict`. I believe that this was a mistake. [1]: https://github.com/napalm-automation/napalm/blob/5bc2bfc40f7bf182eaf0c91a6752d25d4f966350/napalm/base/base.py#L1557 (base) [2]: https://github.com/napalm-automation/napalm/blob/5bc2bfc40f7bf182eaf0c91a6752d25d4f966350/napalm/eos/eos.py#L2017 (eos) [3]: https://github.com/napalm-automation/napalm/blob/5bc2bfc40f7bf182eaf0c91a6752d25d4f966350/napalm/ios/ios.py#L934 (ios) [4]: https://github.com/napalm-automation/napalm/blob/5bc2bfc40f7bf182eaf0c91a6752d25d4f966350/napalm/junos/junos.py#L2404 (junos) [5]: https://github.com/napalm-automation/napalm/blob/5bc2bfc40f7bf182eaf0c91a6752d25d4f966350/napalm/nxos_ssh/nxos_ssh.py#L1634 (nxos_ssh) [6]: https://github.com/napalm-automation/napalm/blob/5bc2bfc40f7bf182eaf0c91a6752d25d4f966350/test/ios/mocked_data/test_get_optics/normal/expected_result.json#L4 (mocked data)
1 parent 5bc2bfc commit 54cab7a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

napalm/base/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@
399399
)
400400

401401
OpticsPhysicalChannelsDict = TypedDict(
402-
"OpticsPhysicalChannelsDict", {"channels": OpticsPerChannelDict}
402+
"OpticsPhysicalChannelsDict", {"channels": List[OpticsPerChannelDict]}
403403
)
404404

405405
OpticsDict = TypedDict("OpticsDict", {"physical_channels": OpticsPhysicalChannelsDict})

0 commit comments

Comments
 (0)