"""What the old ``_sudo`` left on every host it reached (NetOrk/netork#1090). Until NetOrk/netork#1039, ``_sudo`` typed ``echo '' | sudo -S -p "" `` into netmiko's interactive shell, and only the part before the first ``&&`` ran as root. napalm-device-types' ``SudoHistoryMixin`` counts and deletes those lines and gives the files back to root; this says what to look for. """ from __future__ import annotations from napalm_device_types import AptProxyMixin, SudoHistoryMixin class LinuxSudoHistoryMixin(SudoHistoryMixin): #: Every line the old ``_sudo`` typed carries it, with the sudo password before it. SUDO_HISTORY_MARKER = "| sudo -S -p " #: Written as the login user where the part that should have been root's came #: after the first ``&&``: snmpd.conf (``configure_snmp_agent``) and apt's proxy. SUDO_ROOT_FILES = ("/etc/snmp/snmpd.conf", AptProxyMixin.APT_PROXY_FILE)