get_interfaces_ip() always reported the speaker's address with prefix_length: 24, a guess presented as a reading. A speaker in a /23 or /25 network was reported wrongly.
cli() returned [] (NAPALM's cli returns a dict) for a speaker that has no CLI, so it read as implemented.
Can the real prefix be read?
No. The driver's only reading of the speaker is SoCo's get_speaker_info(), which parses /xml/device_description.xml: room name, serial, versions, model, MAC — no address, no netmask (the driver's info.get("ip_address", self.hostname) always fell back to the hostname). SoCo 0.31 has no netmask or prefix reading anywhere; its only netmask is the scan range of its own discovery, the local host's networks. So per the issue the getter goes back to NAPALM's stub.
Fix
The get_interfaces_ip and cli overrides are removed; NAPALM's stubs raise NotImplementedError. get_interfaces() (the one wlan0 connection) is unchanged.
For netOrk: the poll asks implements_napalm_getter(conn, "get_interfaces_ip") first, so a Sonos speaker's interface simply carries no address there instead of a wrong /24; the device keeps its management address.
README (Supported / Not supported) and CHANGELOG [Unreleased] (marked breaking: both now raise) updated.
Tests
Fixtures only.
get_interfaces_ip joins the parametrised "is NAPALM's stub" test; test_get_interfaces_ip_says_not_implemented; test_cli_is_napalms_stub (identity and NotImplementedError). All three failed before.
The old test_get_interfaces_ip (asserting the guessed entry) is removed, and the no-eth0 test no longer reads get_interfaces_ip.
## What was wrong
- `get_interfaces_ip()` always reported the speaker's address with `prefix_length: 24`, a guess presented as a reading. A speaker in a /23 or /25 network was reported wrongly.
- `cli()` returned `[]` (NAPALM's `cli` returns a dict) for a speaker that has no CLI, so it read as implemented.
## Can the real prefix be read?
No. The driver's only reading of the speaker is SoCo's `get_speaker_info()`, which parses `/xml/device_description.xml`: room name, serial, versions, model, MAC — no address, no netmask (the driver's `info.get("ip_address", self.hostname)` always fell back to the hostname). SoCo 0.31 has no netmask or prefix reading anywhere; its only netmask is the scan range of its own discovery, the local host's networks. So per the issue the getter goes back to NAPALM's stub.
## Fix
The `get_interfaces_ip` and `cli` overrides are removed; NAPALM's stubs raise `NotImplementedError`. `get_interfaces()` (the one `wlan0` connection) is unchanged.
For netOrk: the poll asks `implements_napalm_getter(conn, "get_interfaces_ip")` first, so a Sonos speaker's interface simply carries no address there instead of a wrong /24; the device keeps its management address.
README (Supported / Not supported) and CHANGELOG `[Unreleased]` (marked breaking: both now raise) updated.
## Tests
Fixtures only.
- `get_interfaces_ip` joins the parametrised "is NAPALM's stub" test; `test_get_interfaces_ip_says_not_implemented`; `test_cli_is_napalms_stub` (identity and `NotImplementedError`). All three failed before.
- The old `test_get_interfaces_ip` (asserting the guessed entry) is removed, and the no-`eth0` test no longer reads `get_interfaces_ip`.
pytest 78 passed (coverage 93 %), ruff, mypy, `napalm-standard check`/`ratchet` green.
Closes #15
get_interfaces_ip reported the speaker's address with a prefix length
of 24 it never read: the speaker info has no netmask, and SoCo offers
no reading for one, so a speaker in a /23 or /25 network was reported
wrongly. cli answered [] -- not even NAPALM's dict shape -- for a
speaker that has no CLI. Both overrides are gone; NAPALM's stubs raise
NotImplementedError.
Closes#15
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
What was wrong
get_interfaces_ip()always reported the speaker's address withprefix_length: 24, a guess presented as a reading. A speaker in a /23 or /25 network was reported wrongly.cli()returned[](NAPALM'sclireturns a dict) for a speaker that has no CLI, so it read as implemented.Can the real prefix be read?
No. The driver's only reading of the speaker is SoCo's
get_speaker_info(), which parses/xml/device_description.xml: room name, serial, versions, model, MAC — no address, no netmask (the driver'sinfo.get("ip_address", self.hostname)always fell back to the hostname). SoCo 0.31 has no netmask or prefix reading anywhere; its only netmask is the scan range of its own discovery, the local host's networks. So per the issue the getter goes back to NAPALM's stub.Fix
The
get_interfaces_ipandclioverrides are removed; NAPALM's stubs raiseNotImplementedError.get_interfaces()(the onewlan0connection) is unchanged.For netOrk: the poll asks
implements_napalm_getter(conn, "get_interfaces_ip")first, so a Sonos speaker's interface simply carries no address there instead of a wrong /24; the device keeps its management address.README (Supported / Not supported) and CHANGELOG
[Unreleased](marked breaking: both now raise) updated.Tests
Fixtures only.
get_interfaces_ipjoins the parametrised "is NAPALM's stub" test;test_get_interfaces_ip_says_not_implemented;test_cli_is_napalms_stub(identity andNotImplementedError). All three failed before.test_get_interfaces_ip(asserting the guessed entry) is removed, and the no-eth0test no longer readsget_interfaces_ip.pytest 78 passed (coverage 93 %), ruff, mypy,
napalm-standard check/ratchetgreen.Closes #15