Module netmiko.asterfusion
Sub-modules
netmiko.asterfusion.asterfusion-
AsterNOS platforms running Enterprise SONiC Distribution by AsterFusion Co.
Classes
class AsterfusionAsterNOSSSH (**kwargs: Any)-
Class for platforms that have no enable mode.
Netmiko translates the meaning of "enable" mode to be a proxy for "can go into config mode". In other words, that you ultimately have privileges to execute configuration changes.
The expectation on platforms that have no method for elevating privileges is that the standard default privileges allow configuration changes.
Consequently check_enable_mode returns True by default for platforms that don't explicitly support enable mode.
Expand source code
class AsterfusionAsterNOSSSH(NoEnable, CiscoSSHConnection): prompt_pattern = r"[>$#]" def __init__(self, _cli_mode: str = "klish", **kwargs: Any) -> None: super().__init__(**kwargs) self._cli_mode = _cli_mode def session_preparation(self) -> None: self._test_channel_read(pattern=self.prompt_pattern) self.set_base_prompt(alt_prompt_terminator="$") if self._cli_mode == "klish": self._enter_shell() self.disable_paging() elif self._cli_mode == "bash": self._enter_bash_cli() def config_mode( self, config_command: str = "configure terminal", pattern: str = r"\#", re_flags: int = 0, ) -> str: return super().config_mode( config_command=config_command, pattern=pattern, re_flags=re_flags ) def _enter_shell(self) -> str: return self._send_command_str("sonic-cli", expect_string=r"\#") def _enter_bash_cli(self) -> str: return self._send_command_str("system bash", expect_string=r"\$") def _enter_vtysh(self) -> str: return self._send_command_str("vtysh", expect_string=r"\#") def disable_paging( self, command: str = "terminal raw-output", delay_factor: Optional[float] = None, cmd_verify: bool = True, pattern: Optional[str] = None, ) -> str: return super().disable_paging( command=command, delay_factor=delay_factor, cmd_verify=cmd_verify, pattern=pattern, ) def save_config( self, cmd: str = "write", confirm: bool = True, confirm_response: str = "y", ) -> str: return super().save_config( cmd=cmd, confirm=confirm, confirm_response=confirm_response )Ancestors
Class variables
var prompt_pattern
Inherited members
CiscoSSHConnection:check_config_modecheck_enable_modecleanupclear_buffercommitconfig_modedisable_pagingdisconnectenableestablish_connectionexit_config_modeexit_enable_modefind_promptis_alivenormalize_cmdnormalize_linefeedsparamiko_cleanupread_channelread_channel_timingread_until_patternread_until_promptread_until_prompt_or_patternrun_ttpsave_configselect_delay_factorsend_commandsend_command_expectsend_command_timingsend_config_from_filesend_config_setsend_multilinesession_preparationset_base_promptset_terminal_widthspecial_login_handlerstrip_ansi_escape_codesstrip_backspacesstrip_commandstrip_prompttelnet_loginwrite_channel