File: accedian_ssh.py

package info (click to toggle)
netmiko 1.4.3-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 556 kB
  • sloc: python: 3,020; makefile: 4
file content (38 lines) | stat: -rw-r--r-- 1,462 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38

from __future__ import unicode_literals
from netmiko.cisco_base_connection import CiscoSSHConnection


class AccedianSSH(CiscoSSHConnection):
    def session_preparation(self):
        self._test_channel_read()
        self.set_base_prompt()

    def check_enable_mode(self, *args, **kwargs):
        raise AttributeError("Accedian devices do not support enable mode!")

    def enable(self, *args, **kwargs):
        raise AttributeError("Accedian devices do not support enable mode!")

    def exit_enable_mode(self, *args, **kwargs):
        raise AttributeError("Accedian devices do not support enable mode!")

    def check_config_mode(self):
        """Accedian devices do not have a config mode."""
        return False

    def config_mode(self):
        """Accedian devices do not have a config mode."""
        return ''

    def exit_config_mode(self):
        """Accedian devices do not have a config mode."""
        return ''

    def set_base_prompt(self, pri_prompt_terminator=':', alt_prompt_terminator='#',
                        delay_factor=2):
        """Sets self.base_prompt: used as delimiter for stripping of trailing prompt in output."""
        super(AccedianSSH, self).set_base_prompt(pri_prompt_terminator=pri_prompt_terminator,
                                                 alt_prompt_terminator=alt_prompt_terminator,
                                                 delay_factor=delay_factor)
        return self.base_prompt