cisco_s300.py 938 B

1234567891011121314151617181920212223242526
  1. from __future__ import unicode_literals
  2. import time
  3. from netmiko.cisco_base_connection import CiscoSSHConnection
  4. class CiscoS300SSH(CiscoSSHConnection):
  5. """
  6. Support for Cisco SG300 series of devices.
  7. Note, must configure the following to disable SG300 from prompting for username twice:
  8. configure terminal
  9. ip ssh password-auth
  10. """
  11. def session_preparation(self):
  12. """Prepare the session after the connection has been established."""
  13. self.ansi_escape_codes = True
  14. self._test_channel_read()
  15. self.set_base_prompt()
  16. self.disable_paging(command="terminal datadump")
  17. self.set_terminal_width(command='terminal width 511')
  18. # Clear the read buffer
  19. time.sleep(.3 * self.global_delay_factor)
  20. def save_config(self, cmd='write memory', confirm=True, confirm_response='Y'):
  21. return super(CiscoS300SSH, self).save_config(cmd=cmd, confirm=confirm)