_send waited for any output ending in #, $ or >. netmiko searches that pattern in everything read so far. A chunk that happened to end in such a line therefore ended the read while the command was still running.
apt's bad-signature line, ... <ftpmaster@ubuntu.com>, did exactly that:
refresh_available_updates returned half its output;
the rest arrived as the next command's output: the remaining lines, the exit status and the prompt;
the update read after it then failed with "no exit status".
A command that ends in echo __NAME=$? is now read until that marker, with a number, and the prompt line after it. That covers __NETORK_RC= and device-types' __APT_RC= and __SVC_RC=.
The echoed command line carries a literal $?, so it cannot match.
Every other command keeps the prompt pattern.
Verification
pytest tests/: 118 passed, 2 warnings in 12.62s. New TestReadToTheEnd feeds a fake channel the real vault-01 chunks and checks:
the refresh reads through the signature line;
the next command reads only its own output;
the echoed command does not count as the marker;
the device-types markers are waited for;
plain commands keep the prompt pattern.
ruff: 0 findings before and after. mypy: the same 47 pre-existing errors before and after.
Live gate test on searxng-01 (netOrk api container, this module injected), with printf 'x <a@b>\n'; sleep 3; printf 'after\n'; echo __NETORK_RC=$?:
old pattern: returned x <a@b>; left after\n__NETORK_RC=0\n<prompt> in the channel;
new pattern: returned everything up to __NETORK_RC=0; the next command read next-ok.
`_send` waited for any output ending in `#`, `$` or `>`. netmiko searches that pattern in everything read so far. A chunk that happened to end in such a line therefore ended the read while the command was still running.
apt's bad-signature line, `... <ftpmaster@ubuntu.com>`, did exactly that:
- `refresh_available_updates` returned half its output;
- the rest arrived as the next command's output: the remaining lines, the exit status and the prompt;
- the update read after it then failed with "no exit status".
This hit nine hosts on 2026-10-06 (netOrk #615).
## Change
A command that ends in `echo __NAME=$?` is now read until that marker, with a number, and the prompt line after it. That covers `__NETORK_RC=` and device-types' `__APT_RC=` and `__SVC_RC=`.
- The echoed command line carries a literal `$?`, so it cannot match.
- Every other command keeps the prompt pattern.
## Verification
- `pytest tests/`: 118 passed, 2 warnings in 12.62s. New `TestReadToTheEnd` feeds a fake channel the real vault-01 chunks and checks:
- the refresh reads through the signature line;
- the next command reads only its own output;
- the echoed command does not count as the marker;
- the device-types markers are waited for;
- plain commands keep the prompt pattern.
- ruff: 0 findings before and after. mypy: the same 47 pre-existing errors before and after.
- **Live gate test on searxng-01** (netOrk api container, this module injected), with `printf 'x <a@b>\n'; sleep 3; printf 'after\n'; echo __NETORK_RC=$?`:
- old pattern: returned `x <a@b>`; left `after\n__NETORK_RC=0\n<prompt>` in the channel;
- new pattern: returned everything up to `__NETORK_RC=0`; the next command read `next-ok`.
_send waited for any output ending in "#", "$" or ">". netmiko matches that
against everything read so far, so a chunk that happened to end in such a
line ended the read while the command still ran. apt's bad-signature line,
"... <ftpmaster@ubuntu.com>", did exactly that: refresh_available_updates
returned half its output, and the rest -- exit status and prompt included --
arrived as the next command's output, so the update read after it failed
with "no exit status" (netOrk #615, seen on nine hosts on 2026-10-06).
A command that ends in "echo __NAME=$?" (__NETORK_RC=, and device-types'
__APT_RC= and __SVC_RC=) is now read until that marker, with a number, and
the prompt line after it. The echoed command line carries a literal $? and
cannot match. Every other command keeps the prompt pattern.
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.
_sendwaited for any output ending in#,$or>. netmiko searches that pattern in everything read so far. A chunk that happened to end in such a line therefore ended the read while the command was still running.apt's bad-signature line,
... <ftpmaster@ubuntu.com>, did exactly that:refresh_available_updatesreturned half its output;This hit nine hosts on 2026-10-06 (netOrk #615).
Change
A command that ends in
echo __NAME=$?is now read until that marker, with a number, and the prompt line after it. That covers__NETORK_RC=and device-types'__APT_RC=and__SVC_RC=.$?, so it cannot match.Verification
pytest tests/: 118 passed, 2 warnings in 12.62s. NewTestReadToTheEndfeeds a fake channel the real vault-01 chunks and checks:printf 'x <a@b>\n'; sleep 3; printf 'after\n'; echo __NETORK_RC=$?:x <a@b>; leftafter\n__NETORK_RC=0\n<prompt>in the channel;__NETORK_RC=0; the next command readnext-ok.