_sudo() sends a plain sudo <cmd> when no sudo_password is set. If sudo then wants a password, its prompt does not match netmiko's expect_string. The call hangs until read_timeout (100 s by default) and then raises.
_run_service_command (#9) already uses sudo -n in that case: it fails at once with "a password is required". Doing the same in _sudo() would give every other caller the same behaviour: package install/uninstall, updates, crontabs, VPN tunnels. That would make the two sudo -n true pre-checks in _action_apt_update_upgrade and _action_fix_snmp unnecessary.
`_sudo()` sends a plain `sudo <cmd>` when no `sudo_password` is set. If sudo then wants a password, its prompt does not match netmiko's `expect_string`. The call hangs until `read_timeout` (100 s by default) and then raises.
`_run_service_command` (#9) already uses `sudo -n` in that case: it fails at once with "a password is required". Doing the same in `_sudo()` would give every other caller the same behaviour: package install/uninstall, updates, crontabs, VPN tunnels. That would make the two `sudo -n true` pre-checks in `_action_apt_update_upgrade` and `_action_fix_snmp` unnecessary.
Already fixed on main by cf8ee38 (2026-10-12): without a sudo password _as_root uses sudo -n sh -c …, which fails at once instead of prompting (test test_without_a_password_sudo_never_waits_for_one). The sudo -n true pre-checks went with run_device_action (272bf21).
Already fixed on main by cf8ee38 (2026-10-12): without a sudo password `_as_root` uses `sudo -n sh -c …`, which fails at once instead of prompting (test `test_without_a_password_sudo_never_waits_for_one`). The `sudo -n true` pre-checks went with `run_device_action` (272bf21).
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.
_sudo()sends a plainsudo <cmd>when nosudo_passwordis set. If sudo then wants a password, its prompt does not match netmiko'sexpect_string. The call hangs untilread_timeout(100 s by default) and then raises._run_service_command(#9) already usessudo -nin that case: it fails at once with "a password is required". Doing the same in_sudo()would give every other caller the same behaviour: package install/uninstall, updates, crontabs, VPN tunnels. That would make the twosudo -n truepre-checks in_action_apt_update_upgradeand_action_fix_snmpunnecessary.Already fixed on main by
cf8ee38(2026-10-12): without a sudo password_as_rootusessudo -n sh -c …, which fails at once instead of prompting (testtest_without_a_password_sudo_never_waits_for_one). Thesudo -n truepre-checks went withrun_device_action(272bf21).