_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.
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.