diff --git a/netmiko/cisco/cisco_apic.py b/netmiko/cisco/cisco_apic.py index 5d41a0be5..bae637453 100644 --- a/netmiko/cisco/cisco_apic.py +++ b/netmiko/cisco/cisco_apic.py @@ -1,6 +1,7 @@ """Subclass specific to Cisco APIC.""" from netmiko.linux.linux_ssh import LinuxSSH +from netmiko.cisco_base_connection import CiscoSSHConnection class CiscoApicSSH(LinuxSSH): @@ -10,4 +11,17 @@ class CiscoApicSSH(LinuxSSH): This class inherit from LinuxSSH because Cisco APIC is based on Linux """ - pass + def session_preparation(self) -> None: + """ + Prepare the session after the connection has been established. + + In LinuxSSH, the disable_paging method does nothing; however, paging is enabled + by default on Cisco APIC. To handle this, we utilize the disable_paging method + from CiscoSSHConnection, the parent class of LinuxSSH. This approach leverages + the shared implementation for Cisco SSH connections and ensures that any updates to + disable_paging in the parent class are inherited. + """ + self.ansi_escape_codes = True + self._test_channel_read(pattern=self.prompt_pattern) + self.set_base_prompt() + CiscoSSHConnection.disable_paging(self, command="terminal length 0")