repo
stringlengths
7
54
path
stringlengths
4
223
func_name
stringlengths
1
134
original_string
stringlengths
75
104k
language
stringclasses
1 value
code
stringlengths
75
104k
code_tokens
listlengths
20
28.4k
docstring
stringlengths
1
46.3k
docstring_tokens
listlengths
1
1.66k
sha
stringlengths
40
40
url
stringlengths
87
315
partition
stringclasses
1 value
summary
stringlengths
4
350
obf_code
stringlengths
7.85k
764k
ktbyers/netmiko
netmiko/_textfsm/_clitable.py
CliTable.sort
def sort(self, cmp=None, key=None, reverse=False): """Overrides sort func to use the KeyValue for the key.""" if not key and self._keys: key = self.KeyValue super(CliTable, self).sort(cmp=cmp, key=key, reverse=reverse)
python
def sort(self, cmp=None, key=None, reverse=False): """Overrides sort func to use the KeyValue for the key.""" if not key and self._keys: key = self.KeyValue super(CliTable, self).sort(cmp=cmp, key=key, reverse=reverse)
[ "def", "sort", "(", "self", ",", "cmp", "=", "None", ",", "key", "=", "None", ",", "reverse", "=", "False", ")", ":", "if", "not", "key", "and", "self", ".", "_keys", ":", "key", "=", "self", ".", "KeyValue", "super", "(", "CliTable", ",", "self"...
Overrides sort func to use the KeyValue for the key.
[ "Overrides", "sort", "func", "to", "use", "the", "KeyValue", "for", "the", "key", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/_textfsm/_clitable.py#L336-L340
train
Overrides sort func to use the KeyValue for the key.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/_textfsm/_clitable.py
CliTable.AddKeys
def AddKeys(self, key_list): """Mark additional columns as being part of the superkey. Supplements the Keys already extracted from the FSM template. Useful when adding new columns to existing tables. Note: This will impact attempts to further 'extend' the table as the superkey must be common bet...
python
def AddKeys(self, key_list): """Mark additional columns as being part of the superkey. Supplements the Keys already extracted from the FSM template. Useful when adding new columns to existing tables. Note: This will impact attempts to further 'extend' the table as the superkey must be common bet...
[ "def", "AddKeys", "(", "self", ",", "key_list", ")", ":", "for", "keyname", "in", "key_list", ":", "if", "keyname", "not", "in", "self", ".", "header", ":", "raise", "KeyError", "(", "\"'%s'\"", "%", "keyname", ")", "self", ".", "_keys", "=", "self", ...
Mark additional columns as being part of the superkey. Supplements the Keys already extracted from the FSM template. Useful when adding new columns to existing tables. Note: This will impact attempts to further 'extend' the table as the superkey must be common between tables for successful extension. ...
[ "Mark", "additional", "columns", "as", "being", "part", "of", "the", "superkey", ".", "Supplements", "the", "Keys", "already", "extracted", "from", "the", "FSM", "template", ".", "Useful", "when", "adding", "new", "columns", "to", "existing", "tables", ".", ...
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/_textfsm/_clitable.py#L344-L360
train
Adds additional columns to the FSM template.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/_textfsm/_clitable.py
CliTable.superkey
def superkey(self): """Returns a set of column names that together constitute the superkey.""" sorted_list = [] for header in self.header: if header in self._keys: sorted_list.append(header) return sorted_list
python
def superkey(self): """Returns a set of column names that together constitute the superkey.""" sorted_list = [] for header in self.header: if header in self._keys: sorted_list.append(header) return sorted_list
[ "def", "superkey", "(", "self", ")", ":", "sorted_list", "=", "[", "]", "for", "header", "in", "self", ".", "header", ":", "if", "header", "in", "self", ".", "_keys", ":", "sorted_list", ".", "append", "(", "header", ")", "return", "sorted_list" ]
Returns a set of column names that together constitute the superkey.
[ "Returns", "a", "set", "of", "column", "names", "that", "together", "constitute", "the", "superkey", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/_textfsm/_clitable.py#L363-L369
train
Returns a set of column names that together constitute the superkey.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/_textfsm/_clitable.py
CliTable.KeyValue
def KeyValue(self, row=None): """Returns the super key value for the row.""" if not row: if self._iterator: # If we are inside an iterator use current row iteration. row = self[self._iterator] else: row = self.row # If no su...
python
def KeyValue(self, row=None): """Returns the super key value for the row.""" if not row: if self._iterator: # If we are inside an iterator use current row iteration. row = self[self._iterator] else: row = self.row # If no su...
[ "def", "KeyValue", "(", "self", ",", "row", "=", "None", ")", ":", "if", "not", "row", ":", "if", "self", ".", "_iterator", ":", "# If we are inside an iterator use current row iteration.", "row", "=", "self", "[", "self", ".", "_iterator", "]", "else", ":",...
Returns the super key value for the row.
[ "Returns", "the", "super", "key", "value", "for", "the", "row", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/_textfsm/_clitable.py#L371-L387
train
Returns the superkey value for the row.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/dell/dell_isilon_ssh.py
DellIsilonSSH.set_base_prompt
def set_base_prompt( self, pri_prompt_terminator="$", alt_prompt_terminator="#", delay_factor=1 ): """Determine base prompt.""" return super(DellIsilonSSH, self).set_base_prompt( pri_prompt_terminator=pri_prompt_terminator, alt_prompt_terminator=alt_prompt_terminator,...
python
def set_base_prompt( self, pri_prompt_terminator="$", alt_prompt_terminator="#", delay_factor=1 ): """Determine base prompt.""" return super(DellIsilonSSH, self).set_base_prompt( pri_prompt_terminator=pri_prompt_terminator, alt_prompt_terminator=alt_prompt_terminator,...
[ "def", "set_base_prompt", "(", "self", ",", "pri_prompt_terminator", "=", "\"$\"", ",", "alt_prompt_terminator", "=", "\"#\"", ",", "delay_factor", "=", "1", ")", ":", "return", "super", "(", "DellIsilonSSH", ",", "self", ")", ".", "set_base_prompt", "(", "pri...
Determine base prompt.
[ "Determine", "base", "prompt", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/dell/dell_isilon_ssh.py#L10-L18
train
Determine base prompt.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/dell/dell_isilon_ssh.py
DellIsilonSSH.strip_ansi_escape_codes
def strip_ansi_escape_codes(self, string_buffer): """Remove Null code""" output = re.sub(r"\x00", "", string_buffer) return super(DellIsilonSSH, self).strip_ansi_escape_codes(output)
python
def strip_ansi_escape_codes(self, string_buffer): """Remove Null code""" output = re.sub(r"\x00", "", string_buffer) return super(DellIsilonSSH, self).strip_ansi_escape_codes(output)
[ "def", "strip_ansi_escape_codes", "(", "self", ",", "string_buffer", ")", ":", "output", "=", "re", ".", "sub", "(", "r\"\\x00\"", ",", "\"\"", ",", "string_buffer", ")", "return", "super", "(", "DellIsilonSSH", ",", "self", ")", ".", "strip_ansi_escape_codes"...
Remove Null code
[ "Remove", "Null", "code" ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/dell/dell_isilon_ssh.py#L20-L23
train
Remove Null code from string_buffer
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/dell/dell_isilon_ssh.py
DellIsilonSSH.session_preparation
def session_preparation(self): """Prepare the session after the connection has been established.""" self.ansi_escape_codes = True self.zsh_mode() self.find_prompt(delay_factor=1) self.set_base_prompt() # Clear the read buffer time.sleep(0.3 * self.global_delay_fac...
python
def session_preparation(self): """Prepare the session after the connection has been established.""" self.ansi_escape_codes = True self.zsh_mode() self.find_prompt(delay_factor=1) self.set_base_prompt() # Clear the read buffer time.sleep(0.3 * self.global_delay_fac...
[ "def", "session_preparation", "(", "self", ")", ":", "self", ".", "ansi_escape_codes", "=", "True", "self", ".", "zsh_mode", "(", ")", "self", ".", "find_prompt", "(", "delay_factor", "=", "1", ")", "self", ".", "set_base_prompt", "(", ")", "# Clear the read...
Prepare the session after the connection has been established.
[ "Prepare", "the", "session", "after", "the", "connection", "has", "been", "established", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/dell/dell_isilon_ssh.py#L25-L33
train
Prepare the session after the connection has been established.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/dell/dell_isilon_ssh.py
DellIsilonSSH.zsh_mode
def zsh_mode(self, delay_factor=1, prompt_terminator="$"): """Run zsh command to unify the environment""" delay_factor = self.select_delay_factor(delay_factor) self.clear_buffer() command = self.RETURN + "zsh" + self.RETURN self.write_channel(command) time.sleep(1 * delay...
python
def zsh_mode(self, delay_factor=1, prompt_terminator="$"): """Run zsh command to unify the environment""" delay_factor = self.select_delay_factor(delay_factor) self.clear_buffer() command = self.RETURN + "zsh" + self.RETURN self.write_channel(command) time.sleep(1 * delay...
[ "def", "zsh_mode", "(", "self", ",", "delay_factor", "=", "1", ",", "prompt_terminator", "=", "\"$\"", ")", ":", "delay_factor", "=", "self", ".", "select_delay_factor", "(", "delay_factor", ")", "self", ".", "clear_buffer", "(", ")", "command", "=", "self",...
Run zsh command to unify the environment
[ "Run", "zsh", "command", "to", "unify", "the", "environment" ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/dell/dell_isilon_ssh.py#L35-L43
train
Run zsh command to unify the environment
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/dell/dell_isilon_ssh.py
DellIsilonSSH.config_mode
def config_mode(self, config_command="sudo su"): """Attempt to become root.""" delay_factor = self.select_delay_factor(delay_factor=1) output = "" if not self.check_config_mode(): output += self.send_command_timing( config_command, strip_prompt=False, strip_co...
python
def config_mode(self, config_command="sudo su"): """Attempt to become root.""" delay_factor = self.select_delay_factor(delay_factor=1) output = "" if not self.check_config_mode(): output += self.send_command_timing( config_command, strip_prompt=False, strip_co...
[ "def", "config_mode", "(", "self", ",", "config_command", "=", "\"sudo su\"", ")", ":", "delay_factor", "=", "self", ".", "select_delay_factor", "(", "delay_factor", "=", "1", ")", "output", "=", "\"\"", "if", "not", "self", ".", "check_config_mode", "(", ")...
Attempt to become root.
[ "Attempt", "to", "become", "root", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/dell/dell_isilon_ssh.py#L69-L84
train
Attempt to become root.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/quanta/quanta_mesh_ssh.py
QuantaMeshSSH.disable_paging
def disable_paging(self, command="no pager", delay_factor=1): """Disable paging""" return super(QuantaMeshSSH, self).disable_paging(command=command)
python
def disable_paging(self, command="no pager", delay_factor=1): """Disable paging""" return super(QuantaMeshSSH, self).disable_paging(command=command)
[ "def", "disable_paging", "(", "self", ",", "command", "=", "\"no pager\"", ",", "delay_factor", "=", "1", ")", ":", "return", "super", "(", "QuantaMeshSSH", ",", "self", ")", ".", "disable_paging", "(", "command", "=", "command", ")" ]
Disable paging
[ "Disable", "paging" ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/quanta/quanta_mesh_ssh.py#L6-L8
train
Disable paging for the current session.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/quanta/quanta_mesh_ssh.py
QuantaMeshSSH.save_config
def save_config( self, cmd="copy running-config startup-config", confirm=False, confirm_response="", ): """Saves Config""" return super(QuantaMeshSSH, self).save_config( cmd=cmd, confirm=confirm, confirm_response=confirm_response )
python
def save_config( self, cmd="copy running-config startup-config", confirm=False, confirm_response="", ): """Saves Config""" return super(QuantaMeshSSH, self).save_config( cmd=cmd, confirm=confirm, confirm_response=confirm_response )
[ "def", "save_config", "(", "self", ",", "cmd", "=", "\"copy running-config startup-config\"", ",", "confirm", "=", "False", ",", "confirm_response", "=", "\"\"", ",", ")", ":", "return", "super", "(", "QuantaMeshSSH", ",", "self", ")", ".", "save_config", "(",...
Saves Config
[ "Saves", "Config" ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/quanta/quanta_mesh_ssh.py#L14-L23
train
Saves Config
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/ssh_autodetect.py
SSHDetect.autodetect
def autodetect(self): """ Try to guess the best 'device_type' based on patterns defined in SSH_MAPPER_BASE Returns ------- best_match : str or None The device type that is currently the best to use to interact with the device """ for device_type, auto...
python
def autodetect(self): """ Try to guess the best 'device_type' based on patterns defined in SSH_MAPPER_BASE Returns ------- best_match : str or None The device type that is currently the best to use to interact with the device """ for device_type, auto...
[ "def", "autodetect", "(", "self", ")", ":", "for", "device_type", ",", "autodetect_dict", "in", "SSH_MAPPER_BASE", ".", "items", "(", ")", ":", "tmp_dict", "=", "autodetect_dict", ".", "copy", "(", ")", "call_method", "=", "tmp_dict", ".", "pop", "(", "\"d...
Try to guess the best 'device_type' based on patterns defined in SSH_MAPPER_BASE Returns ------- best_match : str or None The device type that is currently the best to use to interact with the device
[ "Try", "to", "guess", "the", "best", "device_type", "based", "on", "patterns", "defined", "in", "SSH_MAPPER_BASE" ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/ssh_autodetect.py#L215-L246
train
Try to guess the best device type based on patterns defined in SSH_MAPPER_BASE and return the device type that is currently the best to use.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/ssh_autodetect.py
SSHDetect._send_command
def _send_command(self, cmd=""): """ Handle reading/writing channel directly. It is also sanitizing the output received. Parameters ---------- cmd : str, optional The command to send to the remote device (default : "", just send a new line) Returns -...
python
def _send_command(self, cmd=""): """ Handle reading/writing channel directly. It is also sanitizing the output received. Parameters ---------- cmd : str, optional The command to send to the remote device (default : "", just send a new line) Returns -...
[ "def", "_send_command", "(", "self", ",", "cmd", "=", "\"\"", ")", ":", "self", ".", "connection", ".", "write_channel", "(", "cmd", "+", "\"\\n\"", ")", "time", ".", "sleep", "(", "1", ")", "output", "=", "self", ".", "connection", ".", "_read_channel...
Handle reading/writing channel directly. It is also sanitizing the output received. Parameters ---------- cmd : str, optional The command to send to the remote device (default : "", just send a new line) Returns ------- output : str The output fr...
[ "Handle", "reading", "/", "writing", "channel", "directly", ".", "It", "is", "also", "sanitizing", "the", "output", "received", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/ssh_autodetect.py#L248-L267
train
Send a command to the remote device.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/ssh_autodetect.py
SSHDetect._send_command_wrapper
def _send_command_wrapper(self, cmd): """ Send command to the remote device with a caching feature to avoid sending the same command twice based on the SSH_MAPPER_BASE dict cmd key. Parameters ---------- cmd : str The command to send to the remote device afte...
python
def _send_command_wrapper(self, cmd): """ Send command to the remote device with a caching feature to avoid sending the same command twice based on the SSH_MAPPER_BASE dict cmd key. Parameters ---------- cmd : str The command to send to the remote device afte...
[ "def", "_send_command_wrapper", "(", "self", ",", "cmd", ")", ":", "cached_results", "=", "self", ".", "_results_cache", ".", "get", "(", "cmd", ")", "if", "not", "cached_results", ":", "response", "=", "self", ".", "_send_command", "(", "cmd", ")", "self"...
Send command to the remote device with a caching feature to avoid sending the same command twice based on the SSH_MAPPER_BASE dict cmd key. Parameters ---------- cmd : str The command to send to the remote device after checking cache. Returns ------- ...
[ "Send", "command", "to", "the", "remote", "device", "with", "a", "caching", "feature", "to", "avoid", "sending", "the", "same", "command", "twice", "based", "on", "the", "SSH_MAPPER_BASE", "dict", "cmd", "key", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/ssh_autodetect.py#L269-L290
train
Send a command to the remote device with caching.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/ssh_autodetect.py
SSHDetect._autodetect_std
def _autodetect_std(self, cmd="", search_patterns=None, re_flags=re.I, priority=99): """ Standard method to try to auto-detect the device type. This method will be called for each device_type present in SSH_MAPPER_BASE dict ('dispatch' key). It will attempt to send a command and match so...
python
def _autodetect_std(self, cmd="", search_patterns=None, re_flags=re.I, priority=99): """ Standard method to try to auto-detect the device type. This method will be called for each device_type present in SSH_MAPPER_BASE dict ('dispatch' key). It will attempt to send a command and match so...
[ "def", "_autodetect_std", "(", "self", ",", "cmd", "=", "\"\"", ",", "search_patterns", "=", "None", ",", "re_flags", "=", "re", ".", "I", ",", "priority", "=", "99", ")", ":", "invalid_responses", "=", "[", "r\"% Invalid input detected\"", ",", "r\"syntax e...
Standard method to try to auto-detect the device type. This method will be called for each device_type present in SSH_MAPPER_BASE dict ('dispatch' key). It will attempt to send a command and match some regular expression from the ouput for each entry in SSH_MAPPER_BASE ('cmd' and 'search_pattern...
[ "Standard", "method", "to", "try", "to", "auto", "-", "detect", "the", "device", "type", ".", "This", "method", "will", "be", "called", "for", "each", "device_type", "present", "in", "SSH_MAPPER_BASE", "dict", "(", "dispatch", "key", ")", ".", "It", "will"...
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/ssh_autodetect.py#L292-L334
train
This method attempts to auto - detect the device type from the command and returns the result.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/alcatel/alcatel_aos_ssh.py
AlcatelAosSSH.save_config
def save_config( self, cmd="write memory flash-synchro", confirm=False, confirm_response="" ): """Save Config""" return super(AlcatelAosSSH, self).save_config( cmd=cmd, confirm=confirm, confirm_response=confirm_response )
python
def save_config( self, cmd="write memory flash-synchro", confirm=False, confirm_response="" ): """Save Config""" return super(AlcatelAosSSH, self).save_config( cmd=cmd, confirm=confirm, confirm_response=confirm_response )
[ "def", "save_config", "(", "self", ",", "cmd", "=", "\"write memory flash-synchro\"", ",", "confirm", "=", "False", ",", "confirm_response", "=", "\"\"", ")", ":", "return", "super", "(", "AlcatelAosSSH", ",", "self", ")", ".", "save_config", "(", "cmd", "="...
Save Config
[ "Save", "Config" ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/alcatel/alcatel_aos_ssh.py#L43-L49
train
Save Config
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/ssh_dispatcher.py
ConnectHandler
def ConnectHandler(*args, **kwargs): """Factory function selects the proper class and creates object based on device_type.""" if kwargs["device_type"] not in platforms: raise ValueError( "Unsupported device_type: " "currently supported platforms are: {}".format(platforms_str) ...
python
def ConnectHandler(*args, **kwargs): """Factory function selects the proper class and creates object based on device_type.""" if kwargs["device_type"] not in platforms: raise ValueError( "Unsupported device_type: " "currently supported platforms are: {}".format(platforms_str) ...
[ "def", "ConnectHandler", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "if", "kwargs", "[", "\"device_type\"", "]", "not", "in", "platforms", ":", "raise", "ValueError", "(", "\"Unsupported device_type: \"", "\"currently supported platforms are: {}\"", ".", ...
Factory function selects the proper class and creates object based on device_type.
[ "Factory", "function", "selects", "the", "proper", "class", "and", "creates", "object", "based", "on", "device_type", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/ssh_dispatcher.py#L223-L231
train
Factory function selects the proper class and creates object based on device_type.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/ssh_dispatcher.py
redispatch
def redispatch(obj, device_type, session_prep=True): """Dynamically change Netmiko object's class to proper class. Generally used with terminal_server device_type when you need to redispatch after interacting with terminal server. """ new_class = ssh_dispatcher(device_type) obj.device_type = de...
python
def redispatch(obj, device_type, session_prep=True): """Dynamically change Netmiko object's class to proper class. Generally used with terminal_server device_type when you need to redispatch after interacting with terminal server. """ new_class = ssh_dispatcher(device_type) obj.device_type = de...
[ "def", "redispatch", "(", "obj", ",", "device_type", ",", "session_prep", "=", "True", ")", ":", "new_class", "=", "ssh_dispatcher", "(", "device_type", ")", "obj", ".", "device_type", "=", "device_type", "obj", ".", "__class__", "=", "new_class", "if", "ses...
Dynamically change Netmiko object's class to proper class. Generally used with terminal_server device_type when you need to redispatch after interacting with terminal server.
[ "Dynamically", "change", "Netmiko", "object", "s", "class", "to", "proper", "class", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/ssh_dispatcher.py#L239-L249
train
Dynamically change Netmiko object s class to proper class.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/ssh_dispatcher.py
FileTransfer
def FileTransfer(*args, **kwargs): """Factory function selects the proper SCP class and creates object based on device_type.""" if len(args) >= 1: device_type = args[0].device_type else: device_type = kwargs["ssh_conn"].device_type if device_type not in scp_platforms: raise Value...
python
def FileTransfer(*args, **kwargs): """Factory function selects the proper SCP class and creates object based on device_type.""" if len(args) >= 1: device_type = args[0].device_type else: device_type = kwargs["ssh_conn"].device_type if device_type not in scp_platforms: raise Value...
[ "def", "FileTransfer", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "if", "len", "(", "args", ")", ">=", "1", ":", "device_type", "=", "args", "[", "0", "]", ".", "device_type", "else", ":", "device_type", "=", "kwargs", "[", "\"ssh_conn\"", ...
Factory function selects the proper SCP class and creates object based on device_type.
[ "Factory", "function", "selects", "the", "proper", "SCP", "class", "and", "creates", "object", "based", "on", "device_type", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/ssh_dispatcher.py#L252-L264
train
Factory function selects the proper SCP class and creates object based on device_type.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
setup.py
find_version
def find_version(*file_paths): """ This pattern was modeled on a method from the Python Packaging User Guide: https://packaging.python.org/en/latest/single_source_version.html We read instead of importing so we don't get import errors if our code imports from dependencies listed in install_requ...
python
def find_version(*file_paths): """ This pattern was modeled on a method from the Python Packaging User Guide: https://packaging.python.org/en/latest/single_source_version.html We read instead of importing so we don't get import errors if our code imports from dependencies listed in install_requ...
[ "def", "find_version", "(", "*", "file_paths", ")", ":", "base_module_file", "=", "os", ".", "path", ".", "join", "(", "*", "file_paths", ")", "with", "open", "(", "base_module_file", ")", "as", "f", ":", "base_module_data", "=", "f", ".", "read", "(", ...
This pattern was modeled on a method from the Python Packaging User Guide: https://packaging.python.org/en/latest/single_source_version.html We read instead of importing so we don't get import errors if our code imports from dependencies listed in install_requires.
[ "This", "pattern", "was", "modeled", "on", "a", "method", "from", "the", "Python", "Packaging", "User", "Guide", ":", "https", ":", "//", "packaging", ".", "python", ".", "org", "/", "en", "/", "latest", "/", "single_source_version", ".", "html" ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/setup.py#L11-L27
train
Find the version string of the base module.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/calix/calix_b6.py
CalixB6Base.session_preparation
def session_preparation(self): """Prepare the session after the connection has been established.""" self.ansi_escape_codes = True self._test_channel_read() self.set_base_prompt() self.disable_paging() self.set_terminal_width(command="terminal width 511") # Clear t...
python
def session_preparation(self): """Prepare the session after the connection has been established.""" self.ansi_escape_codes = True self._test_channel_read() self.set_base_prompt() self.disable_paging() self.set_terminal_width(command="terminal width 511") # Clear t...
[ "def", "session_preparation", "(", "self", ")", ":", "self", ".", "ansi_escape_codes", "=", "True", "self", ".", "_test_channel_read", "(", ")", "self", ".", "set_base_prompt", "(", ")", "self", ".", "disable_paging", "(", ")", "self", ".", "set_terminal_width...
Prepare the session after the connection has been established.
[ "Prepare", "the", "session", "after", "the", "connection", "has", "been", "established", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/calix/calix_b6.py#L28-L37
train
Prepare the session after the connection has been established.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/calix/calix_b6.py
CalixB6Base.check_config_mode
def check_config_mode(self, check_string=")#", pattern=""): """Checks if the device is in configuration mode""" return super(CalixB6Base, self).check_config_mode(check_string=check_string)
python
def check_config_mode(self, check_string=")#", pattern=""): """Checks if the device is in configuration mode""" return super(CalixB6Base, self).check_config_mode(check_string=check_string)
[ "def", "check_config_mode", "(", "self", ",", "check_string", "=", "\")#\"", ",", "pattern", "=", "\"\"", ")", ":", "return", "super", "(", "CalixB6Base", ",", "self", ")", ".", "check_config_mode", "(", "check_string", "=", "check_string", ")" ]
Checks if the device is in configuration mode
[ "Checks", "if", "the", "device", "is", "in", "configuration", "mode" ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/calix/calix_b6.py#L64-L66
train
Checks if the device is in configuration mode
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/mellanox/mellanox_ssh.py
MellanoxSSH.disable_paging
def disable_paging(self, command="terminal length 999", delay_factor=1): """Disable paging default to a Cisco CLI method.""" delay_factor = self.select_delay_factor(delay_factor) time.sleep(delay_factor * 0.1) self.clear_buffer() command = self.normalize_cmd(command) log....
python
def disable_paging(self, command="terminal length 999", delay_factor=1): """Disable paging default to a Cisco CLI method.""" delay_factor = self.select_delay_factor(delay_factor) time.sleep(delay_factor * 0.1) self.clear_buffer() command = self.normalize_cmd(command) log....
[ "def", "disable_paging", "(", "self", ",", "command", "=", "\"terminal length 999\"", ",", "delay_factor", "=", "1", ")", ":", "delay_factor", "=", "self", ".", "select_delay_factor", "(", "delay_factor", ")", "time", ".", "sleep", "(", "delay_factor", "*", "0...
Disable paging default to a Cisco CLI method.
[ "Disable", "paging", "default", "to", "a", "Cisco", "CLI", "method", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/mellanox/mellanox_ssh.py#L23-L37
train
Disable paging default to a Cisco CLI method.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/mellanox/mellanox_ssh.py
MellanoxSSH.save_config
def save_config( self, cmd="configuration write", confirm=False, confirm_response="" ): """Save Config on Mellanox devices Enters and Leaves Config Mode""" output = self.enable() output += self.config_mode() output += self.send_command(cmd) output += self.exit_config_...
python
def save_config( self, cmd="configuration write", confirm=False, confirm_response="" ): """Save Config on Mellanox devices Enters and Leaves Config Mode""" output = self.enable() output += self.config_mode() output += self.send_command(cmd) output += self.exit_config_...
[ "def", "save_config", "(", "self", ",", "cmd", "=", "\"configuration write\"", ",", "confirm", "=", "False", ",", "confirm_response", "=", "\"\"", ")", ":", "output", "=", "self", ".", "enable", "(", ")", "output", "+=", "self", ".", "config_mode", "(", ...
Save Config on Mellanox devices Enters and Leaves Config Mode
[ "Save", "Config", "on", "Mellanox", "devices", "Enters", "and", "Leaves", "Config", "Mode" ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/mellanox/mellanox_ssh.py#L50-L58
train
Save Config on Mellanox devices Enters and Leaves Config Mode
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/rad/rad_etx.py
RadETXBase.config_mode
def config_mode(self, config_command="config", pattern=">config"): """Enter into configuration mode on remote device.""" return super(RadETXBase, self).config_mode( config_command=config_command, pattern=pattern )
python
def config_mode(self, config_command="config", pattern=">config"): """Enter into configuration mode on remote device.""" return super(RadETXBase, self).config_mode( config_command=config_command, pattern=pattern )
[ "def", "config_mode", "(", "self", ",", "config_command", "=", "\"config\"", ",", "pattern", "=", "\">config\"", ")", ":", "return", "super", "(", "RadETXBase", ",", "self", ")", ".", "config_mode", "(", "config_command", "=", "config_command", ",", "pattern",...
Enter into configuration mode on remote device.
[ "Enter", "into", "configuration", "mode", "on", "remote", "device", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/rad/rad_etx.py#L44-L48
train
Enter into configuration mode on remote device.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/rad/rad_etx.py
RadETXBase.check_config_mode
def check_config_mode(self, check_string=">config", pattern=""): """ Checks if the device is in configuration mode or not. Rad config starts with baseprompt>config. """ return super(RadETXBase, self).check_config_mode( check_string=check_string, pattern=pattern ...
python
def check_config_mode(self, check_string=">config", pattern=""): """ Checks if the device is in configuration mode or not. Rad config starts with baseprompt>config. """ return super(RadETXBase, self).check_config_mode( check_string=check_string, pattern=pattern ...
[ "def", "check_config_mode", "(", "self", ",", "check_string", "=", "\">config\"", ",", "pattern", "=", "\"\"", ")", ":", "return", "super", "(", "RadETXBase", ",", "self", ")", ".", "check_config_mode", "(", "check_string", "=", "check_string", ",", "pattern",...
Checks if the device is in configuration mode or not. Rad config starts with baseprompt>config.
[ "Checks", "if", "the", "device", "is", "in", "configuration", "mode", "or", "not", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/rad/rad_etx.py#L50-L58
train
Checks if the device is in configuration mode or not.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/rad/rad_etx.py
RadETXBase.exit_config_mode
def exit_config_mode(self, exit_config="exit all", pattern="#"): """Exit from configuration mode.""" return super(RadETXBase, self).exit_config_mode( exit_config=exit_config, pattern=pattern )
python
def exit_config_mode(self, exit_config="exit all", pattern="#"): """Exit from configuration mode.""" return super(RadETXBase, self).exit_config_mode( exit_config=exit_config, pattern=pattern )
[ "def", "exit_config_mode", "(", "self", ",", "exit_config", "=", "\"exit all\"", ",", "pattern", "=", "\"#\"", ")", ":", "return", "super", "(", "RadETXBase", ",", "self", ")", ".", "exit_config_mode", "(", "exit_config", "=", "exit_config", ",", "pattern", ...
Exit from configuration mode.
[ "Exit", "from", "configuration", "mode", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/rad/rad_etx.py#L60-L64
train
Exit from configuration mode.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/rad/rad_etx.py
RadETXTelnet.telnet_login
def telnet_login( self, username_pattern=r"(?:user>)", alt_prompt_term=r"#\s*$", **kwargs ): """ RAD presents with the following on login user> password> **** """ self.TELNET_RETURN = self.RETURN return super(RadETXTelnet, self).telnet_login( ...
python
def telnet_login( self, username_pattern=r"(?:user>)", alt_prompt_term=r"#\s*$", **kwargs ): """ RAD presents with the following on login user> password> **** """ self.TELNET_RETURN = self.RETURN return super(RadETXTelnet, self).telnet_login( ...
[ "def", "telnet_login", "(", "self", ",", "username_pattern", "=", "r\"(?:user>)\"", ",", "alt_prompt_term", "=", "r\"#\\s*$\"", ",", "*", "*", "kwargs", ")", ":", "self", ".", "TELNET_RETURN", "=", "self", ".", "RETURN", "return", "super", "(", "RadETXTelnet",...
RAD presents with the following on login user> password> ****
[ "RAD", "presents", "with", "the", "following", "on", "login" ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/rad/rad_etx.py#L79-L94
train
Telenet login with optional prompt term.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/vyos/vyos_ssh.py
VyOSSSH.config_mode
def config_mode(self, config_command="configure", pattern=r"[edit]"): """Enter configuration mode.""" return super(VyOSSSH, self).config_mode( config_command=config_command, pattern=pattern )
python
def config_mode(self, config_command="configure", pattern=r"[edit]"): """Enter configuration mode.""" return super(VyOSSSH, self).config_mode( config_command=config_command, pattern=pattern )
[ "def", "config_mode", "(", "self", ",", "config_command", "=", "\"configure\"", ",", "pattern", "=", "r\"[edit]\"", ")", ":", "return", "super", "(", "VyOSSSH", ",", "self", ")", ".", "config_mode", "(", "config_command", "=", "config_command", ",", "pattern",...
Enter configuration mode.
[ "Enter", "configuration", "mode", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/vyos/vyos_ssh.py#L35-L39
train
Enter configuration mode.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/vyos/vyos_ssh.py
VyOSSSH.commit
def commit(self, comment="", delay_factor=0.1): """ Commit the candidate configuration. Commit the entered configuration. Raise an error and return the failure if the commit fails. default: command_string = commit comment: command_string = commit c...
python
def commit(self, comment="", delay_factor=0.1): """ Commit the candidate configuration. Commit the entered configuration. Raise an error and return the failure if the commit fails. default: command_string = commit comment: command_string = commit c...
[ "def", "commit", "(", "self", ",", "comment", "=", "\"\"", ",", "delay_factor", "=", "0.1", ")", ":", "delay_factor", "=", "self", ".", "select_delay_factor", "(", "delay_factor", ")", "error_marker", "=", "[", "\"Failed to generate committed config\"", ",", "\"...
Commit the candidate configuration. Commit the entered configuration. Raise an error and return the failure if the commit fails. default: command_string = commit comment: command_string = commit comment <comment>
[ "Commit", "the", "candidate", "configuration", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/vyos/vyos_ssh.py#L56-L88
train
Commit the candidate configuration.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/vyos/vyos_ssh.py
VyOSSSH.send_config_set
def send_config_set( self, config_commands=None, exit_config_mode=False, delay_factor=1, max_loops=150, strip_prompt=False, strip_command=False, config_mode_command=None, ): """Remain in configuration mode.""" return super(VyOSSSH, self...
python
def send_config_set( self, config_commands=None, exit_config_mode=False, delay_factor=1, max_loops=150, strip_prompt=False, strip_command=False, config_mode_command=None, ): """Remain in configuration mode.""" return super(VyOSSSH, self...
[ "def", "send_config_set", "(", "self", ",", "config_commands", "=", "None", ",", "exit_config_mode", "=", "False", ",", "delay_factor", "=", "1", ",", "max_loops", "=", "150", ",", "strip_prompt", "=", "False", ",", "strip_command", "=", "False", ",", "confi...
Remain in configuration mode.
[ "Remain", "in", "configuration", "mode", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/vyos/vyos_ssh.py#L103-L122
train
Remain in configuration mode.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/cisco_base_connection.py
CiscoBaseConnection.check_config_mode
def check_config_mode(self, check_string=")#", pattern=""): """ Checks if the device is in configuration mode or not. Cisco IOS devices abbreviate the prompt at 20 chars in config mode """ return super(CiscoBaseConnection, self).check_config_mode( check_string=check_...
python
def check_config_mode(self, check_string=")#", pattern=""): """ Checks if the device is in configuration mode or not. Cisco IOS devices abbreviate the prompt at 20 chars in config mode """ return super(CiscoBaseConnection, self).check_config_mode( check_string=check_...
[ "def", "check_config_mode", "(", "self", ",", "check_string", "=", "\")#\"", ",", "pattern", "=", "\"\"", ")", ":", "return", "super", "(", "CiscoBaseConnection", ",", "self", ")", ".", "check_config_mode", "(", "check_string", "=", "check_string", ",", "patte...
Checks if the device is in configuration mode or not. Cisco IOS devices abbreviate the prompt at 20 chars in config mode
[ "Checks", "if", "the", "device", "is", "in", "configuration", "mode", "or", "not", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/cisco_base_connection.py#L31-L39
train
Checks if the device is in configuration mode or not.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/cisco_base_connection.py
CiscoBaseConnection.config_mode
def config_mode(self, config_command="config term", pattern=""): """ Enter into configuration mode on remote device. Cisco IOS devices abbreviate the prompt at 20 chars in config mode """ if not pattern: pattern = re.escape(self.base_prompt[:16]) return super...
python
def config_mode(self, config_command="config term", pattern=""): """ Enter into configuration mode on remote device. Cisco IOS devices abbreviate the prompt at 20 chars in config mode """ if not pattern: pattern = re.escape(self.base_prompt[:16]) return super...
[ "def", "config_mode", "(", "self", ",", "config_command", "=", "\"config term\"", ",", "pattern", "=", "\"\"", ")", ":", "if", "not", "pattern", ":", "pattern", "=", "re", ".", "escape", "(", "self", ".", "base_prompt", "[", ":", "16", "]", ")", "retur...
Enter into configuration mode on remote device. Cisco IOS devices abbreviate the prompt at 20 chars in config mode
[ "Enter", "into", "configuration", "mode", "on", "remote", "device", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/cisco_base_connection.py#L41-L51
train
Enter into configuration mode on remote device.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/cisco_base_connection.py
CiscoBaseConnection.exit_config_mode
def exit_config_mode(self, exit_config="end", pattern="#"): """Exit from configuration mode.""" return super(CiscoBaseConnection, self).exit_config_mode( exit_config=exit_config, pattern=pattern )
python
def exit_config_mode(self, exit_config="end", pattern="#"): """Exit from configuration mode.""" return super(CiscoBaseConnection, self).exit_config_mode( exit_config=exit_config, pattern=pattern )
[ "def", "exit_config_mode", "(", "self", ",", "exit_config", "=", "\"end\"", ",", "pattern", "=", "\"#\"", ")", ":", "return", "super", "(", "CiscoBaseConnection", ",", "self", ")", ".", "exit_config_mode", "(", "exit_config", "=", "exit_config", ",", "pattern"...
Exit from configuration mode.
[ "Exit", "from", "configuration", "mode", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/cisco_base_connection.py#L53-L57
train
Exit from configuration mode.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/cisco_base_connection.py
CiscoBaseConnection._autodetect_fs
def _autodetect_fs(self, cmd="dir", pattern=r"Directory of (.*)/"): """Autodetect the file system on the remote device. Used by SCP operations.""" if not self.check_enable_mode(): raise ValueError("Must be in enable mode to auto-detect the file-system.") output = self.send_command_ex...
python
def _autodetect_fs(self, cmd="dir", pattern=r"Directory of (.*)/"): """Autodetect the file system on the remote device. Used by SCP operations.""" if not self.check_enable_mode(): raise ValueError("Must be in enable mode to auto-detect the file-system.") output = self.send_command_ex...
[ "def", "_autodetect_fs", "(", "self", ",", "cmd", "=", "\"dir\"", ",", "pattern", "=", "r\"Directory of (.*)/\"", ")", ":", "if", "not", "self", ".", "check_enable_mode", "(", ")", ":", "raise", "ValueError", "(", "\"Must be in enable mode to auto-detect the file-sy...
Autodetect the file system on the remote device. Used by SCP operations.
[ "Autodetect", "the", "file", "system", "on", "the", "remote", "device", ".", "Used", "by", "SCP", "operations", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/cisco_base_connection.py#L183-L205
train
Autodetect the file system on the remote device. Used by SCP operations.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/mrv/mrv_ssh.py
MrvOptiswitchSSH.enable
def enable(self, cmd="enable", pattern=r"#", re_flags=re.IGNORECASE): """Enable mode on MRV uses no password.""" output = "" if not self.check_enable_mode(): self.write_channel(self.normalize_cmd(cmd)) output += self.read_until_prompt_or_pattern( pattern=p...
python
def enable(self, cmd="enable", pattern=r"#", re_flags=re.IGNORECASE): """Enable mode on MRV uses no password.""" output = "" if not self.check_enable_mode(): self.write_channel(self.normalize_cmd(cmd)) output += self.read_until_prompt_or_pattern( pattern=p...
[ "def", "enable", "(", "self", ",", "cmd", "=", "\"enable\"", ",", "pattern", "=", "r\"#\"", ",", "re_flags", "=", "re", ".", "IGNORECASE", ")", ":", "output", "=", "\"\"", "if", "not", "self", ".", "check_enable_mode", "(", ")", ":", "self", ".", "wr...
Enable mode on MRV uses no password.
[ "Enable", "mode", "on", "MRV", "uses", "no", "password", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/mrv/mrv_ssh.py#L23-L37
train
Enable mode on MRV uses no password.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/mrv/mrv_ssh.py
MrvOptiswitchSSH.save_config
def save_config(self, cmd="save config flash", confirm=False, confirm_response=""): """Saves configuration.""" return super(MrvOptiswitchSSH, self).save_config( cmd=cmd, confirm=confirm, confirm_response=confirm_response )
python
def save_config(self, cmd="save config flash", confirm=False, confirm_response=""): """Saves configuration.""" return super(MrvOptiswitchSSH, self).save_config( cmd=cmd, confirm=confirm, confirm_response=confirm_response )
[ "def", "save_config", "(", "self", ",", "cmd", "=", "\"save config flash\"", ",", "confirm", "=", "False", ",", "confirm_response", "=", "\"\"", ")", ":", "return", "super", "(", "MrvOptiswitchSSH", ",", "self", ")", ".", "save_config", "(", "cmd", "=", "c...
Saves configuration.
[ "Saves", "configuration", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/mrv/mrv_ssh.py#L39-L43
train
Saves configuration.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/netapp/netapp_cdot_ssh.py
NetAppcDotSSH.session_preparation
def session_preparation(self): """Prepare the session after the connection has been established.""" self.set_base_prompt() cmd = self.RETURN + "rows 0" + self.RETURN self.disable_paging(command=cmd)
python
def session_preparation(self): """Prepare the session after the connection has been established.""" self.set_base_prompt() cmd = self.RETURN + "rows 0" + self.RETURN self.disable_paging(command=cmd)
[ "def", "session_preparation", "(", "self", ")", ":", "self", ".", "set_base_prompt", "(", ")", "cmd", "=", "self", ".", "RETURN", "+", "\"rows 0\"", "+", "self", ".", "RETURN", "self", ".", "disable_paging", "(", "command", "=", "cmd", ")" ]
Prepare the session after the connection has been established.
[ "Prepare", "the", "session", "after", "the", "connection", "has", "been", "established", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/netapp/netapp_cdot_ssh.py#L7-L11
train
Prepare the session after the connection has been established.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/base_connection.py
BaseConnection._timeout_exceeded
def _timeout_exceeded(self, start, msg="Timeout exceeded!"): """Raise NetMikoTimeoutException if waiting too much in the serving queue. :param start: Initial start time to see if session lock timeout has been exceeded :type start: float (from time.time() call i.e. epoch time) :param ms...
python
def _timeout_exceeded(self, start, msg="Timeout exceeded!"): """Raise NetMikoTimeoutException if waiting too much in the serving queue. :param start: Initial start time to see if session lock timeout has been exceeded :type start: float (from time.time() call i.e. epoch time) :param ms...
[ "def", "_timeout_exceeded", "(", "self", ",", "start", ",", "msg", "=", "\"Timeout exceeded!\"", ")", ":", "if", "not", "start", ":", "# Must provide a comparison time", "return", "False", "if", "time", ".", "time", "(", ")", "-", "start", ">", "self", ".", ...
Raise NetMikoTimeoutException if waiting too much in the serving queue. :param start: Initial start time to see if session lock timeout has been exceeded :type start: float (from time.time() call i.e. epoch time) :param msg: Exception message if timeout was exceeded :type msg: str
[ "Raise", "NetMikoTimeoutException", "if", "waiting", "too", "much", "in", "the", "serving", "queue", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/base_connection.py#L327-L342
train
Raise NetMikoTimeoutException if waiting too much in the serving queue.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/base_connection.py
BaseConnection._lock_netmiko_session
def _lock_netmiko_session(self, start=None): """Try to acquire the Netmiko session lock. If not available, wait in the queue until the channel is available again. :param start: Initial start time to measure the session timeout :type start: float (from time.time() call i.e. epoch time) ...
python
def _lock_netmiko_session(self, start=None): """Try to acquire the Netmiko session lock. If not available, wait in the queue until the channel is available again. :param start: Initial start time to measure the session timeout :type start: float (from time.time() call i.e. epoch time) ...
[ "def", "_lock_netmiko_session", "(", "self", ",", "start", "=", "None", ")", ":", "if", "not", "start", ":", "start", "=", "time", ".", "time", "(", ")", "# Wait here until the SSH channel lock is acquired or until session_timeout exceeded", "while", "not", "self", ...
Try to acquire the Netmiko session lock. If not available, wait in the queue until the channel is available again. :param start: Initial start time to measure the session timeout :type start: float (from time.time() call i.e. epoch time)
[ "Try", "to", "acquire", "the", "Netmiko", "session", "lock", ".", "If", "not", "available", "wait", "in", "the", "queue", "until", "the", "channel", "is", "available", "again", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/base_connection.py#L344-L358
train
Try to acquire the Netmiko session lock. If not available wait in the queue until the session_timeout exceeded.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/base_connection.py
BaseConnection._write_channel
def _write_channel(self, out_data): """Generic handler that will write to both SSH and telnet channel. :param out_data: data to be written to the channel :type out_data: str (can be either unicode/byte string) """ if self.protocol == "ssh": self.remote_conn.sendall(w...
python
def _write_channel(self, out_data): """Generic handler that will write to both SSH and telnet channel. :param out_data: data to be written to the channel :type out_data: str (can be either unicode/byte string) """ if self.protocol == "ssh": self.remote_conn.sendall(w...
[ "def", "_write_channel", "(", "self", ",", "out_data", ")", ":", "if", "self", ".", "protocol", "==", "\"ssh\"", ":", "self", ".", "remote_conn", ".", "sendall", "(", "write_bytes", "(", "out_data", ",", "encoding", "=", "self", ".", "encoding", ")", ")"...
Generic handler that will write to both SSH and telnet channel. :param out_data: data to be written to the channel :type out_data: str (can be either unicode/byte string)
[ "Generic", "handler", "that", "will", "write", "to", "both", "SSH", "and", "telnet", "channel", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/base_connection.py#L367-L392
train
Generic handler that will write to both SSH and telnet channel.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/base_connection.py
BaseConnection.write_channel
def write_channel(self, out_data): """Generic handler that will write to both SSH and telnet channel. :param out_data: data to be written to the channel :type out_data: str (can be either unicode/byte string) """ self._lock_netmiko_session() try: self._write_...
python
def write_channel(self, out_data): """Generic handler that will write to both SSH and telnet channel. :param out_data: data to be written to the channel :type out_data: str (can be either unicode/byte string) """ self._lock_netmiko_session() try: self._write_...
[ "def", "write_channel", "(", "self", ",", "out_data", ")", ":", "self", ".", "_lock_netmiko_session", "(", ")", "try", ":", "self", ".", "_write_channel", "(", "out_data", ")", "finally", ":", "# Always unlock the SSH channel, even on exception.", "self", ".", "_u...
Generic handler that will write to both SSH and telnet channel. :param out_data: data to be written to the channel :type out_data: str (can be either unicode/byte string)
[ "Generic", "handler", "that", "will", "write", "to", "both", "SSH", "and", "telnet", "channel", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/base_connection.py#L399-L410
train
Generic handler that will write to both SSH and telnet channel.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/base_connection.py
BaseConnection.is_alive
def is_alive(self): """Returns a boolean flag with the state of the connection.""" null = chr(0) if self.remote_conn is None: log.error("Connection is not initialised, is_alive returns False") return False if self.protocol == "telnet": try: ...
python
def is_alive(self): """Returns a boolean flag with the state of the connection.""" null = chr(0) if self.remote_conn is None: log.error("Connection is not initialised, is_alive returns False") return False if self.protocol == "telnet": try: ...
[ "def", "is_alive", "(", "self", ")", ":", "null", "=", "chr", "(", "0", ")", "if", "self", ".", "remote_conn", "is", "None", ":", "log", ".", "error", "(", "\"Connection is not initialised, is_alive returns False\"", ")", "return", "False", "if", "self", "."...
Returns a boolean flag with the state of the connection.
[ "Returns", "a", "boolean", "flag", "with", "the", "state", "of", "the", "connection", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/base_connection.py#L412-L441
train
Returns a boolean flag with the state of the connection.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/base_connection.py
BaseConnection._read_channel
def _read_channel(self): """Generic handler that will read all the data from an SSH or telnet channel.""" if self.protocol == "ssh": output = "" while True: if self.remote_conn.recv_ready(): outbuf = self.remote_conn.recv(MAX_BUFFER) ...
python
def _read_channel(self): """Generic handler that will read all the data from an SSH or telnet channel.""" if self.protocol == "ssh": output = "" while True: if self.remote_conn.recv_ready(): outbuf = self.remote_conn.recv(MAX_BUFFER) ...
[ "def", "_read_channel", "(", "self", ")", ":", "if", "self", ".", "protocol", "==", "\"ssh\"", ":", "output", "=", "\"\"", "while", "True", ":", "if", "self", ".", "remote_conn", ".", "recv_ready", "(", ")", ":", "outbuf", "=", "self", ".", "remote_con...
Generic handler that will read all the data from an SSH or telnet channel.
[ "Generic", "handler", "that", "will", "read", "all", "the", "data", "from", "an", "SSH", "or", "telnet", "channel", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/base_connection.py#L443-L465
train
Generic handler that will read all the data from an SSH or telnet channel.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/base_connection.py
BaseConnection.read_channel
def read_channel(self): """Generic handler that will read all the data from an SSH or telnet channel.""" output = "" self._lock_netmiko_session() try: output = self._read_channel() finally: # Always unlock the SSH channel, even on exception. se...
python
def read_channel(self): """Generic handler that will read all the data from an SSH or telnet channel.""" output = "" self._lock_netmiko_session() try: output = self._read_channel() finally: # Always unlock the SSH channel, even on exception. se...
[ "def", "read_channel", "(", "self", ")", ":", "output", "=", "\"\"", "self", ".", "_lock_netmiko_session", "(", ")", "try", ":", "output", "=", "self", ".", "_read_channel", "(", ")", "finally", ":", "# Always unlock the SSH channel, even on exception.", "self", ...
Generic handler that will read all the data from an SSH or telnet channel.
[ "Generic", "handler", "that", "will", "read", "all", "the", "data", "from", "an", "SSH", "or", "telnet", "channel", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/base_connection.py#L467-L476
train
Generic handler that will read all the data from an SSH or telnet channel.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/base_connection.py
BaseConnection._read_channel_expect
def _read_channel_expect(self, pattern="", re_flags=0, max_loops=150): """Function that reads channel until pattern is detected. pattern takes a regular expression. By default pattern will be self.base_prompt Note: this currently reads beyond pattern. In the case of SSH it reads MAX_B...
python
def _read_channel_expect(self, pattern="", re_flags=0, max_loops=150): """Function that reads channel until pattern is detected. pattern takes a regular expression. By default pattern will be self.base_prompt Note: this currently reads beyond pattern. In the case of SSH it reads MAX_B...
[ "def", "_read_channel_expect", "(", "self", ",", "pattern", "=", "\"\"", ",", "re_flags", "=", "0", ",", "max_loops", "=", "150", ")", ":", "output", "=", "\"\"", "if", "not", "pattern", ":", "pattern", "=", "re", ".", "escape", "(", "self", ".", "ba...
Function that reads channel until pattern is detected. pattern takes a regular expression. By default pattern will be self.base_prompt Note: this currently reads beyond pattern. In the case of SSH it reads MAX_BUFFER. In the case of telnet it reads all non-blocking data. Ther...
[ "Function", "that", "reads", "channel", "until", "pattern", "is", "detected", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/base_connection.py#L478-L541
train
Function that reads channel until pattern is detected.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/base_connection.py
BaseConnection._read_channel_timing
def _read_channel_timing(self, delay_factor=1, max_loops=150): """Read data on the channel based on timing delays. Attempt to read channel max_loops number of times. If no data this will cause a 15 second delay. Once data is encountered read channel for another two seconds (2 * delay_f...
python
def _read_channel_timing(self, delay_factor=1, max_loops=150): """Read data on the channel based on timing delays. Attempt to read channel max_loops number of times. If no data this will cause a 15 second delay. Once data is encountered read channel for another two seconds (2 * delay_f...
[ "def", "_read_channel_timing", "(", "self", ",", "delay_factor", "=", "1", ",", "max_loops", "=", "150", ")", ":", "# Time to delay in each read loop", "loop_delay", "=", "0.1", "final_delay", "=", "2", "# Default to making loop time be roughly equivalent to self.timeout (s...
Read data on the channel based on timing delays. Attempt to read channel max_loops number of times. If no data this will cause a 15 second delay. Once data is encountered read channel for another two seconds (2 * delay_factor) to make sure reading of channel is complete. :para...
[ "Read", "data", "on", "the", "channel", "based", "on", "timing", "delays", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/base_connection.py#L543-L586
train
Read data on the channel based on timing delays.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/base_connection.py
BaseConnection.read_until_prompt_or_pattern
def read_until_prompt_or_pattern(self, pattern="", re_flags=0): """Read until either self.base_prompt or pattern is detected. :param pattern: the pattern used to identify that the output is complete (i.e. stop \ reading when pattern is detected). pattern will be combined with self.base_prompt t...
python
def read_until_prompt_or_pattern(self, pattern="", re_flags=0): """Read until either self.base_prompt or pattern is detected. :param pattern: the pattern used to identify that the output is complete (i.e. stop \ reading when pattern is detected). pattern will be combined with self.base_prompt t...
[ "def", "read_until_prompt_or_pattern", "(", "self", ",", "pattern", "=", "\"\"", ",", "re_flags", "=", "0", ")", ":", "combined_pattern", "=", "re", ".", "escape", "(", "self", ".", "base_prompt", ")", "if", "pattern", ":", "combined_pattern", "=", "r\"({}|{...
Read until either self.base_prompt or pattern is detected. :param pattern: the pattern used to identify that the output is complete (i.e. stop \ reading when pattern is detected). pattern will be combined with self.base_prompt to \ terminate output reading when the first of self.base_prompt or ...
[ "Read", "until", "either", "self", ".", "base_prompt", "or", "pattern", "is", "detected", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/base_connection.py#L596-L612
train
Read until either self. base_prompt or pattern is detected.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/base_connection.py
BaseConnection.telnet_login
def telnet_login( self, pri_prompt_terminator=r"#\s*$", alt_prompt_terminator=r">\s*$", username_pattern=r"(?:user:|username|login|user name)", pwd_pattern=r"assword", delay_factor=1, max_loops=20, ): """Telnet login. Can be username/password or just p...
python
def telnet_login( self, pri_prompt_terminator=r"#\s*$", alt_prompt_terminator=r">\s*$", username_pattern=r"(?:user:|username|login|user name)", pwd_pattern=r"assword", delay_factor=1, max_loops=20, ): """Telnet login. Can be username/password or just p...
[ "def", "telnet_login", "(", "self", ",", "pri_prompt_terminator", "=", "r\"#\\s*$\"", ",", "alt_prompt_terminator", "=", "r\">\\s*$\"", ",", "username_pattern", "=", "r\"(?:user:|username|login|user name)\"", ",", "pwd_pattern", "=", "r\"assword\"", ",", "delay_factor", "...
Telnet login. Can be username/password or just password. :param pri_prompt_terminator: Primary trailing delimiter for identifying a device prompt :type pri_prompt_terminator: str :param alt_prompt_terminator: Alternate trailing delimiter for identifying a device prompt :type alt_prompt...
[ "Telnet", "login", ".", "Can", "be", "username", "/", "password", "or", "just", "password", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/base_connection.py#L632-L713
train
Telnet login.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/base_connection.py
BaseConnection._use_ssh_config
def _use_ssh_config(self, dict_arg): """Update SSH connection parameters based on contents of SSH 'config' file. :param dict_arg: Dictionary of SSH connection parameters :type dict_arg: dict """ connect_dict = dict_arg.copy() # Use SSHConfig to generate source content. ...
python
def _use_ssh_config(self, dict_arg): """Update SSH connection parameters based on contents of SSH 'config' file. :param dict_arg: Dictionary of SSH connection parameters :type dict_arg: dict """ connect_dict = dict_arg.copy() # Use SSHConfig to generate source content. ...
[ "def", "_use_ssh_config", "(", "self", ",", "dict_arg", ")", ":", "connect_dict", "=", "dict_arg", ".", "copy", "(", ")", "# Use SSHConfig to generate source content.", "full_path", "=", "path", ".", "abspath", "(", "path", ".", "expanduser", "(", "self", ".", ...
Update SSH connection parameters based on contents of SSH 'config' file. :param dict_arg: Dictionary of SSH connection parameters :type dict_arg: dict
[ "Update", "SSH", "connection", "parameters", "based", "on", "contents", "of", "SSH", "config", "file", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/base_connection.py#L751-L786
train
Update SSH connection parameters based on contents of SSH config file.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/base_connection.py
BaseConnection._connect_params_dict
def _connect_params_dict(self): """Generate dictionary of Paramiko connection parameters.""" conn_dict = { "hostname": self.host, "port": self.port, "username": self.username, "password": self.password, "look_for_keys": self.use_keys, ...
python
def _connect_params_dict(self): """Generate dictionary of Paramiko connection parameters.""" conn_dict = { "hostname": self.host, "port": self.port, "username": self.username, "password": self.password, "look_for_keys": self.use_keys, ...
[ "def", "_connect_params_dict", "(", "self", ")", ":", "conn_dict", "=", "{", "\"hostname\"", ":", "self", ".", "host", ",", "\"port\"", ":", "self", ".", "port", ",", "\"username\"", ":", "self", ".", "username", ",", "\"password\"", ":", "self", ".", "p...
Generate dictionary of Paramiko connection parameters.
[ "Generate", "dictionary", "of", "Paramiko", "connection", "parameters", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/base_connection.py#L788-L807
train
Generate dictionary of Paramiko connection parameters.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/base_connection.py
BaseConnection._sanitize_output
def _sanitize_output( self, output, strip_command=False, command_string=None, strip_prompt=False ): """Strip out command echo, trailing router prompt and ANSI escape codes. :param output: Output from a remote network device :type output: unicode string :param strip_command:...
python
def _sanitize_output( self, output, strip_command=False, command_string=None, strip_prompt=False ): """Strip out command echo, trailing router prompt and ANSI escape codes. :param output: Output from a remote network device :type output: unicode string :param strip_command:...
[ "def", "_sanitize_output", "(", "self", ",", "output", ",", "strip_command", "=", "False", ",", "command_string", "=", "None", ",", "strip_prompt", "=", "False", ")", ":", "if", "self", ".", "ansi_escape_codes", ":", "output", "=", "self", ".", "strip_ansi_e...
Strip out command echo, trailing router prompt and ANSI escape codes. :param output: Output from a remote network device :type output: unicode string :param strip_command: :type strip_command:
[ "Strip", "out", "command", "echo", "trailing", "router", "prompt", "and", "ANSI", "escape", "codes", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/base_connection.py#L809-L828
train
Strip out command echo trailing router prompt and ANSI escape codes.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/base_connection.py
BaseConnection.establish_connection
def establish_connection(self, width=None, height=None): """Establish SSH connection to the network device Timeout will generate a NetMikoTimeoutException Authentication failure will generate a NetMikoAuthenticationException width and height are needed for Fortinet paging setting. ...
python
def establish_connection(self, width=None, height=None): """Establish SSH connection to the network device Timeout will generate a NetMikoTimeoutException Authentication failure will generate a NetMikoAuthenticationException width and height are needed for Fortinet paging setting. ...
[ "def", "establish_connection", "(", "self", ",", "width", "=", "None", ",", "height", "=", "None", ")", ":", "if", "self", ".", "protocol", "==", "\"telnet\"", ":", "self", ".", "remote_conn", "=", "telnetlib", ".", "Telnet", "(", "self", ".", "host", ...
Establish SSH connection to the network device Timeout will generate a NetMikoTimeoutException Authentication failure will generate a NetMikoAuthenticationException width and height are needed for Fortinet paging setting. :param width: Specified width of the VT100 terminal window ...
[ "Establish", "SSH", "connection", "to", "the", "network", "device" ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/base_connection.py#L830-L892
train
Establish SSH connection to the network device.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/base_connection.py
BaseConnection._build_ssh_client
def _build_ssh_client(self): """Prepare for Paramiko SSH connection.""" # Create instance of SSHClient object remote_conn_pre = paramiko.SSHClient() # Load host_keys for better SSH security if self.system_host_keys: remote_conn_pre.load_system_host_keys() if ...
python
def _build_ssh_client(self): """Prepare for Paramiko SSH connection.""" # Create instance of SSHClient object remote_conn_pre = paramiko.SSHClient() # Load host_keys for better SSH security if self.system_host_keys: remote_conn_pre.load_system_host_keys() if ...
[ "def", "_build_ssh_client", "(", "self", ")", ":", "# Create instance of SSHClient object", "remote_conn_pre", "=", "paramiko", ".", "SSHClient", "(", ")", "# Load host_keys for better SSH security", "if", "self", ".", "system_host_keys", ":", "remote_conn_pre", ".", "loa...
Prepare for Paramiko SSH connection.
[ "Prepare", "for", "Paramiko", "SSH", "connection", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/base_connection.py#L935-L948
train
Prepare for Paramiko SSH connection.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/base_connection.py
BaseConnection.select_delay_factor
def select_delay_factor(self, delay_factor): """ Choose the greater of delay_factor or self.global_delay_factor (default). In fast_cli choose the lesser of delay_factor of self.global_delay_factor. :param delay_factor: See __init__: global_delay_factor :type delay_factor: int ...
python
def select_delay_factor(self, delay_factor): """ Choose the greater of delay_factor or self.global_delay_factor (default). In fast_cli choose the lesser of delay_factor of self.global_delay_factor. :param delay_factor: See __init__: global_delay_factor :type delay_factor: int ...
[ "def", "select_delay_factor", "(", "self", ",", "delay_factor", ")", ":", "if", "self", ".", "fast_cli", ":", "if", "delay_factor", "<=", "self", ".", "global_delay_factor", ":", "return", "delay_factor", "else", ":", "return", "self", ".", "global_delay_factor"...
Choose the greater of delay_factor or self.global_delay_factor (default). In fast_cli choose the lesser of delay_factor of self.global_delay_factor. :param delay_factor: See __init__: global_delay_factor :type delay_factor: int
[ "Choose", "the", "greater", "of", "delay_factor", "or", "self", ".", "global_delay_factor", "(", "default", ")", ".", "In", "fast_cli", "choose", "the", "lesser", "of", "delay_factor", "of", "self", ".", "global_delay_factor", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/base_connection.py#L950-L967
train
In fast_cli choose the greater or lesser of delay_factor or self. global_delay_factor.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/base_connection.py
BaseConnection.set_terminal_width
def set_terminal_width(self, command="", delay_factor=1): """CLI terminals try to automatically adjust the line based on the width of the terminal. This causes the output to get distorted when accessed programmatically. Set terminal width to 511 which works on a broad set of devices. :...
python
def set_terminal_width(self, command="", delay_factor=1): """CLI terminals try to automatically adjust the line based on the width of the terminal. This causes the output to get distorted when accessed programmatically. Set terminal width to 511 which works on a broad set of devices. :...
[ "def", "set_terminal_width", "(", "self", ",", "command", "=", "\"\"", ",", "delay_factor", "=", "1", ")", ":", "if", "not", "command", ":", "return", "\"\"", "delay_factor", "=", "self", ".", "select_delay_factor", "(", "delay_factor", ")", "command", "=", ...
CLI terminals try to automatically adjust the line based on the width of the terminal. This causes the output to get distorted when accessed programmatically. Set terminal width to 511 which works on a broad set of devices. :param command: Command string to send to the device :type com...
[ "CLI", "terminals", "try", "to", "automatically", "adjust", "the", "line", "based", "on", "the", "width", "of", "the", "terminal", ".", "This", "causes", "the", "output", "to", "get", "distorted", "when", "accessed", "programmatically", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/base_connection.py#L996-L1016
train
This function is used to set the terminal width for the command line.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/base_connection.py
BaseConnection.set_base_prompt
def set_base_prompt( self, pri_prompt_terminator="#", alt_prompt_terminator=">", delay_factor=1 ): """Sets self.base_prompt Used as delimiter for stripping of trailing prompt in output. Should be set to something that is general and applies in multiple contexts. For Cisco d...
python
def set_base_prompt( self, pri_prompt_terminator="#", alt_prompt_terminator=">", delay_factor=1 ): """Sets self.base_prompt Used as delimiter for stripping of trailing prompt in output. Should be set to something that is general and applies in multiple contexts. For Cisco d...
[ "def", "set_base_prompt", "(", "self", ",", "pri_prompt_terminator", "=", "\"#\"", ",", "alt_prompt_terminator", "=", "\">\"", ",", "delay_factor", "=", "1", ")", ":", "prompt", "=", "self", ".", "find_prompt", "(", "delay_factor", "=", "delay_factor", ")", "i...
Sets self.base_prompt Used as delimiter for stripping of trailing prompt in output. Should be set to something that is general and applies in multiple contexts. For Cisco devices this will be set to router hostname (i.e. prompt without '>' or '#'). This will be set on entering user ex...
[ "Sets", "self", ".", "base_prompt" ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/base_connection.py#L1018-L1045
train
Sets self. base_prompt to the router hostname for the given Cisco base entry.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/base_connection.py
BaseConnection.find_prompt
def find_prompt(self, delay_factor=1): """Finds the current network device prompt, last line only. :param delay_factor: See __init__: global_delay_factor :type delay_factor: int """ delay_factor = self.select_delay_factor(delay_factor) self.clear_buffer() self.wr...
python
def find_prompt(self, delay_factor=1): """Finds the current network device prompt, last line only. :param delay_factor: See __init__: global_delay_factor :type delay_factor: int """ delay_factor = self.select_delay_factor(delay_factor) self.clear_buffer() self.wr...
[ "def", "find_prompt", "(", "self", ",", "delay_factor", "=", "1", ")", ":", "delay_factor", "=", "self", ".", "select_delay_factor", "(", "delay_factor", ")", "self", ".", "clear_buffer", "(", ")", "self", ".", "write_channel", "(", "self", ".", "RETURN", ...
Finds the current network device prompt, last line only. :param delay_factor: See __init__: global_delay_factor :type delay_factor: int
[ "Finds", "the", "current", "network", "device", "prompt", "last", "line", "only", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/base_connection.py#L1047-L1084
train
Finds the current network device prompt.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/base_connection.py
BaseConnection.send_command_timing
def send_command_timing( self, command_string, delay_factor=1, max_loops=150, strip_prompt=True, strip_command=True, normalize=True, use_textfsm=False, ): """Execute command_string on the SSH channel using a delay-based mechanism. Generally ...
python
def send_command_timing( self, command_string, delay_factor=1, max_loops=150, strip_prompt=True, strip_command=True, normalize=True, use_textfsm=False, ): """Execute command_string on the SSH channel using a delay-based mechanism. Generally ...
[ "def", "send_command_timing", "(", "self", ",", "command_string", ",", "delay_factor", "=", "1", ",", "max_loops", "=", "150", ",", "strip_prompt", "=", "True", ",", "strip_command", "=", "True", ",", "normalize", "=", "True", ",", "use_textfsm", "=", "False...
Execute command_string on the SSH channel using a delay-based mechanism. Generally used for show commands. :param command_string: The command to be executed on the remote device. :type command_string: str :param delay_factor: Multiplying factor used to adjust delays (default: 1). ...
[ "Execute", "command_string", "on", "the", "SSH", "channel", "using", "a", "delay", "-", "based", "mechanism", ".", "Generally", "used", "for", "show", "commands", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/base_connection.py#L1090-L1145
train
Send a command to the remote device using a delay - based mechanism.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/base_connection.py
BaseConnection.strip_prompt
def strip_prompt(self, a_string): """Strip the trailing router prompt from the output. :param a_string: Returned string from device :type a_string: str """ response_list = a_string.split(self.RESPONSE_RETURN) last_line = response_list[-1] if self.base_prompt in l...
python
def strip_prompt(self, a_string): """Strip the trailing router prompt from the output. :param a_string: Returned string from device :type a_string: str """ response_list = a_string.split(self.RESPONSE_RETURN) last_line = response_list[-1] if self.base_prompt in l...
[ "def", "strip_prompt", "(", "self", ",", "a_string", ")", ":", "response_list", "=", "a_string", ".", "split", "(", "self", ".", "RESPONSE_RETURN", ")", "last_line", "=", "response_list", "[", "-", "1", "]", "if", "self", ".", "base_prompt", "in", "last_li...
Strip the trailing router prompt from the output. :param a_string: Returned string from device :type a_string: str
[ "Strip", "the", "trailing", "router", "prompt", "from", "the", "output", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/base_connection.py#L1147-L1158
train
Strip the trailing router prompt from the output.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/base_connection.py
BaseConnection._first_line_handler
def _first_line_handler(self, data, search_pattern): """ In certain situations the first line will get repainted which causes a false match on the terminating pattern. Filter this out. returns a tuple of (data, first_line_processed) Where data is the original data pote...
python
def _first_line_handler(self, data, search_pattern): """ In certain situations the first line will get repainted which causes a false match on the terminating pattern. Filter this out. returns a tuple of (data, first_line_processed) Where data is the original data pote...
[ "def", "_first_line_handler", "(", "self", ",", "data", ",", "search_pattern", ")", ":", "try", ":", "# First line is the echo line containing the command. In certain situations", "# it gets repainted and needs filtered", "lines", "=", "data", ".", "split", "(", "self", "."...
In certain situations the first line will get repainted which causes a false match on the terminating pattern. Filter this out. returns a tuple of (data, first_line_processed) Where data is the original data potentially with the first line modified and the first_line_processed...
[ "In", "certain", "situations", "the", "first", "line", "will", "get", "repainted", "which", "causes", "a", "false", "match", "on", "the", "terminating", "pattern", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/base_connection.py#L1160-L1185
train
This function handles the first line of the catalina command.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/base_connection.py
BaseConnection.send_command
def send_command( self, command_string, expect_string=None, delay_factor=1, max_loops=500, auto_find_prompt=True, strip_prompt=True, strip_command=True, normalize=True, use_textfsm=False, ): """Execute command_string on the SSH ...
python
def send_command( self, command_string, expect_string=None, delay_factor=1, max_loops=500, auto_find_prompt=True, strip_prompt=True, strip_command=True, normalize=True, use_textfsm=False, ): """Execute command_string on the SSH ...
[ "def", "send_command", "(", "self", ",", "command_string", ",", "expect_string", "=", "None", ",", "delay_factor", "=", "1", ",", "max_loops", "=", "500", ",", "auto_find_prompt", "=", "True", ",", "strip_prompt", "=", "True", ",", "strip_command", "=", "Tru...
Execute command_string on the SSH channel using a pattern-based mechanism. Generally used for show commands. By default this method will keep waiting to receive data until the network device prompt is detected. The current network device prompt will be determined automatically. :param c...
[ "Execute", "command_string", "on", "the", "SSH", "channel", "using", "a", "pattern", "-", "based", "mechanism", ".", "Generally", "used", "for", "show", "commands", ".", "By", "default", "this", "method", "will", "keep", "waiting", "to", "receive", "data", "...
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/base_connection.py#L1187-L1309
train
Send a command string to the remote device.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/base_connection.py
BaseConnection.strip_command
def strip_command(self, command_string, output): """ Strip command_string from output string Cisco IOS adds backspaces into output for long commands (i.e. for commands that line wrap) :param command_string: The command string sent to the device :type command_string: str ...
python
def strip_command(self, command_string, output): """ Strip command_string from output string Cisco IOS adds backspaces into output for long commands (i.e. for commands that line wrap) :param command_string: The command string sent to the device :type command_string: str ...
[ "def", "strip_command", "(", "self", ",", "command_string", ",", "output", ")", ":", "backspace_char", "=", "\"\\x08\"", "# Check for line wrap (remove backspaces)", "if", "backspace_char", "in", "output", ":", "output", "=", "output", ".", "replace", "(", "backspac...
Strip command_string from output string Cisco IOS adds backspaces into output for long commands (i.e. for commands that line wrap) :param command_string: The command string sent to the device :type command_string: str :param output: The returned output as a result of the command strin...
[ "Strip", "command_string", "from", "output", "string" ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/base_connection.py#L1332-L1354
train
This function strips the command_string from the output string and returns the result of the command.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/base_connection.py
BaseConnection.normalize_linefeeds
def normalize_linefeeds(self, a_string): """Convert `\r\r\n`,`\r\n`, `\n\r` to `\n.` :param a_string: A string that may have non-normalized line feeds i.e. output returned from device, or a device prompt :type a_string: str """ newline = re.compile("(\r\r\r\n|\r\r\n|...
python
def normalize_linefeeds(self, a_string): """Convert `\r\r\n`,`\r\n`, `\n\r` to `\n.` :param a_string: A string that may have non-normalized line feeds i.e. output returned from device, or a device prompt :type a_string: str """ newline = re.compile("(\r\r\r\n|\r\r\n|...
[ "def", "normalize_linefeeds", "(", "self", ",", "a_string", ")", ":", "newline", "=", "re", ".", "compile", "(", "\"(\\r\\r\\r\\n|\\r\\r\\n|\\r\\n|\\n\\r)\"", ")", "a_string", "=", "newline", ".", "sub", "(", "self", ".", "RESPONSE_RETURN", ",", "a_string", ")",...
Convert `\r\r\n`,`\r\n`, `\n\r` to `\n.` :param a_string: A string that may have non-normalized line feeds i.e. output returned from device, or a device prompt :type a_string: str
[ "Convert", "\\", "r", "\\", "r", "\\", "n", "\\", "r", "\\", "n", "\\", "n", "\\", "r", "to", "\\", "n", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/base_connection.py#L1356-L1367
train
Convert any line feeds that are not allowed by the device to \ n.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/base_connection.py
BaseConnection.normalize_cmd
def normalize_cmd(self, command): """Normalize CLI commands to have a single trailing newline. :param command: Command that may require line feed to be normalized :type command: str """ command = command.rstrip() command += self.RETURN return command
python
def normalize_cmd(self, command): """Normalize CLI commands to have a single trailing newline. :param command: Command that may require line feed to be normalized :type command: str """ command = command.rstrip() command += self.RETURN return command
[ "def", "normalize_cmd", "(", "self", ",", "command", ")", ":", "command", "=", "command", ".", "rstrip", "(", ")", "command", "+=", "self", ".", "RETURN", "return", "command" ]
Normalize CLI commands to have a single trailing newline. :param command: Command that may require line feed to be normalized :type command: str
[ "Normalize", "CLI", "commands", "to", "have", "a", "single", "trailing", "newline", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/base_connection.py#L1369-L1377
train
Normalize CLI commands to have a single trailing newline.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/base_connection.py
BaseConnection.check_enable_mode
def check_enable_mode(self, check_string=""): """Check if in enable mode. Return boolean. :param check_string: Identification of privilege mode from device :type check_string: str """ self.write_channel(self.RETURN) output = self.read_until_prompt() return check_...
python
def check_enable_mode(self, check_string=""): """Check if in enable mode. Return boolean. :param check_string: Identification of privilege mode from device :type check_string: str """ self.write_channel(self.RETURN) output = self.read_until_prompt() return check_...
[ "def", "check_enable_mode", "(", "self", ",", "check_string", "=", "\"\"", ")", ":", "self", ".", "write_channel", "(", "self", ".", "RETURN", ")", "output", "=", "self", ".", "read_until_prompt", "(", ")", "return", "check_string", "in", "output" ]
Check if in enable mode. Return boolean. :param check_string: Identification of privilege mode from device :type check_string: str
[ "Check", "if", "in", "enable", "mode", ".", "Return", "boolean", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/base_connection.py#L1379-L1387
train
Check if the device is in enable mode. Return boolean.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/base_connection.py
BaseConnection.enable
def enable(self, cmd="", pattern="ssword", re_flags=re.IGNORECASE): """Enter enable mode. :param cmd: Device command to enter enable mode :type cmd: str :param pattern: pattern to search for indicating device is waiting for password :type pattern: str :param re_flags: ...
python
def enable(self, cmd="", pattern="ssword", re_flags=re.IGNORECASE): """Enter enable mode. :param cmd: Device command to enter enable mode :type cmd: str :param pattern: pattern to search for indicating device is waiting for password :type pattern: str :param re_flags: ...
[ "def", "enable", "(", "self", ",", "cmd", "=", "\"\"", ",", "pattern", "=", "\"ssword\"", ",", "re_flags", "=", "re", ".", "IGNORECASE", ")", ":", "output", "=", "\"\"", "msg", "=", "(", "\"Failed to enter enable mode. Please ensure you pass \"", "\"the 'secret'...
Enter enable mode. :param cmd: Device command to enter enable mode :type cmd: str :param pattern: pattern to search for indicating device is waiting for password :type pattern: str :param re_flags: Regular expression flags used in conjunction with pattern :type re_flag...
[ "Enter", "enable", "mode", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/base_connection.py#L1389-L1418
train
Enter enable mode.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/base_connection.py
BaseConnection.exit_enable_mode
def exit_enable_mode(self, exit_command=""): """Exit enable mode. :param exit_command: Command that exits the session from privileged mode :type exit_command: str """ output = "" if self.check_enable_mode(): self.write_channel(self.normalize_cmd(exit_command)...
python
def exit_enable_mode(self, exit_command=""): """Exit enable mode. :param exit_command: Command that exits the session from privileged mode :type exit_command: str """ output = "" if self.check_enable_mode(): self.write_channel(self.normalize_cmd(exit_command)...
[ "def", "exit_enable_mode", "(", "self", ",", "exit_command", "=", "\"\"", ")", ":", "output", "=", "\"\"", "if", "self", ".", "check_enable_mode", "(", ")", ":", "self", ".", "write_channel", "(", "self", ".", "normalize_cmd", "(", "exit_command", ")", ")"...
Exit enable mode. :param exit_command: Command that exits the session from privileged mode :type exit_command: str
[ "Exit", "enable", "mode", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/base_connection.py#L1420-L1432
train
Exit enable mode.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/base_connection.py
BaseConnection.check_config_mode
def check_config_mode(self, check_string="", pattern=""): """Checks if the device is in configuration mode or not. :param check_string: Identification of configuration mode from the device :type check_string: str :param pattern: Pattern to terminate reading of channel :type pat...
python
def check_config_mode(self, check_string="", pattern=""): """Checks if the device is in configuration mode or not. :param check_string: Identification of configuration mode from the device :type check_string: str :param pattern: Pattern to terminate reading of channel :type pat...
[ "def", "check_config_mode", "(", "self", ",", "check_string", "=", "\"\"", ",", "pattern", "=", "\"\"", ")", ":", "self", ".", "write_channel", "(", "self", ".", "RETURN", ")", "# You can encounter an issue here (on router name changes) prefer delay-based solution", "if...
Checks if the device is in configuration mode or not. :param check_string: Identification of configuration mode from the device :type check_string: str :param pattern: Pattern to terminate reading of channel :type pattern: str
[ "Checks", "if", "the", "device", "is", "in", "configuration", "mode", "or", "not", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/base_connection.py#L1434-L1449
train
Checks if the device is in configuration mode or not.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/base_connection.py
BaseConnection.config_mode
def config_mode(self, config_command="", pattern=""): """Enter into config_mode. :param config_command: Configuration command to send to the device :type config_command: str :param pattern: Pattern to terminate reading of channel :type pattern: str """ output = ...
python
def config_mode(self, config_command="", pattern=""): """Enter into config_mode. :param config_command: Configuration command to send to the device :type config_command: str :param pattern: Pattern to terminate reading of channel :type pattern: str """ output = ...
[ "def", "config_mode", "(", "self", ",", "config_command", "=", "\"\"", ",", "pattern", "=", "\"\"", ")", ":", "output", "=", "\"\"", "if", "not", "self", ".", "check_config_mode", "(", ")", ":", "self", ".", "write_channel", "(", "self", ".", "normalize_...
Enter into config_mode. :param config_command: Configuration command to send to the device :type config_command: str :param pattern: Pattern to terminate reading of channel :type pattern: str
[ "Enter", "into", "config_mode", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/base_connection.py#L1451-L1466
train
Enter into config_mode.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/base_connection.py
BaseConnection.exit_config_mode
def exit_config_mode(self, exit_config="", pattern=""): """Exit from configuration mode. :param exit_config: Command to exit configuration mode :type exit_config: str :param pattern: Pattern to terminate reading of channel :type pattern: str """ output = "" ...
python
def exit_config_mode(self, exit_config="", pattern=""): """Exit from configuration mode. :param exit_config: Command to exit configuration mode :type exit_config: str :param pattern: Pattern to terminate reading of channel :type pattern: str """ output = "" ...
[ "def", "exit_config_mode", "(", "self", ",", "exit_config", "=", "\"\"", ",", "pattern", "=", "\"\"", ")", ":", "output", "=", "\"\"", "if", "self", ".", "check_config_mode", "(", ")", ":", "self", ".", "write_channel", "(", "self", ".", "normalize_cmd", ...
Exit from configuration mode. :param exit_config: Command to exit configuration mode :type exit_config: str :param pattern: Pattern to terminate reading of channel :type pattern: str
[ "Exit", "from", "configuration", "mode", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/base_connection.py#L1468-L1484
train
Exit from configuration mode.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/base_connection.py
BaseConnection.send_config_from_file
def send_config_from_file(self, config_file=None, **kwargs): """ Send configuration commands down the SSH channel from a file. The file is processed line-by-line and each command is sent down the SSH channel. **kwargs are passed to send_config_set method. :param config...
python
def send_config_from_file(self, config_file=None, **kwargs): """ Send configuration commands down the SSH channel from a file. The file is processed line-by-line and each command is sent down the SSH channel. **kwargs are passed to send_config_set method. :param config...
[ "def", "send_config_from_file", "(", "self", ",", "config_file", "=", "None", ",", "*", "*", "kwargs", ")", ":", "with", "io", ".", "open", "(", "config_file", ",", "\"rt\"", ",", "encoding", "=", "\"utf-8\"", ")", "as", "cfg_file", ":", "return", "self"...
Send configuration commands down the SSH channel from a file. The file is processed line-by-line and each command is sent down the SSH channel. **kwargs are passed to send_config_set method. :param config_file: Path to configuration file to be sent to the device :type config_f...
[ "Send", "configuration", "commands", "down", "the", "SSH", "channel", "from", "a", "file", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/base_connection.py#L1486-L1502
train
Send configuration commands down the SSH channel from a file.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/base_connection.py
BaseConnection.send_config_set
def send_config_set( self, config_commands=None, exit_config_mode=True, delay_factor=1, max_loops=150, strip_prompt=False, strip_command=False, config_mode_command=None, ): """ Send configuration commands down the SSH channel. ...
python
def send_config_set( self, config_commands=None, exit_config_mode=True, delay_factor=1, max_loops=150, strip_prompt=False, strip_command=False, config_mode_command=None, ): """ Send configuration commands down the SSH channel. ...
[ "def", "send_config_set", "(", "self", ",", "config_commands", "=", "None", ",", "exit_config_mode", "=", "True", ",", "delay_factor", "=", "1", ",", "max_loops", "=", "150", ",", "strip_prompt", "=", "False", ",", "strip_command", "=", "False", ",", "config...
Send configuration commands down the SSH channel. config_commands is an iterable containing all of the configuration commands. The commands will be executed one after the other. Automatically exits/enters configuration mode. :param config_commands: Multiple configuration commands to b...
[ "Send", "configuration", "commands", "down", "the", "SSH", "channel", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/base_connection.py#L1504-L1570
train
Send configuration commands down the SSH channel.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/base_connection.py
BaseConnection.strip_ansi_escape_codes
def strip_ansi_escape_codes(self, string_buffer): """ Remove any ANSI (VT100) ESC codes from the output http://en.wikipedia.org/wiki/ANSI_escape_code Note: this does not capture ALL possible ANSI Escape Codes only the ones I have encountered Current codes that are filt...
python
def strip_ansi_escape_codes(self, string_buffer): """ Remove any ANSI (VT100) ESC codes from the output http://en.wikipedia.org/wiki/ANSI_escape_code Note: this does not capture ALL possible ANSI Escape Codes only the ones I have encountered Current codes that are filt...
[ "def", "strip_ansi_escape_codes", "(", "self", ",", "string_buffer", ")", ":", "# noqa", "log", ".", "debug", "(", "\"In strip_ansi_escape_codes\"", ")", "log", ".", "debug", "(", "\"repr = {}\"", ".", "format", "(", "repr", "(", "string_buffer", ")", ")", ")"...
Remove any ANSI (VT100) ESC codes from the output http://en.wikipedia.org/wiki/ANSI_escape_code Note: this does not capture ALL possible ANSI Escape Codes only the ones I have encountered Current codes that are filtered: ESC = '\x1b' or chr(27) ESC = is the escape char...
[ "Remove", "any", "ANSI", "(", "VT100", ")", "ESC", "codes", "from", "the", "output" ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/base_connection.py#L1572-L1658
train
This function strips any ANSI escape codes from the output string_buffer.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/base_connection.py
BaseConnection.disconnect
def disconnect(self): """Try to gracefully close the SSH connection.""" try: self.cleanup() if self.protocol == "ssh": self.paramiko_cleanup() elif self.protocol == "telnet": self.remote_conn.close() elif self.protocol == "s...
python
def disconnect(self): """Try to gracefully close the SSH connection.""" try: self.cleanup() if self.protocol == "ssh": self.paramiko_cleanup() elif self.protocol == "telnet": self.remote_conn.close() elif self.protocol == "s...
[ "def", "disconnect", "(", "self", ")", ":", "try", ":", "self", ".", "cleanup", "(", ")", "if", "self", ".", "protocol", "==", "\"ssh\"", ":", "self", ".", "paramiko_cleanup", "(", ")", "elif", "self", ".", "protocol", "==", "\"telnet\"", ":", "self", ...
Try to gracefully close the SSH connection.
[ "Try", "to", "gracefully", "close", "the", "SSH", "connection", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/base_connection.py#L1669-L1685
train
Try to gracefully close the SSH connection.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/base_connection.py
BaseConnection.open_session_log
def open_session_log(self, filename, mode="write"): """Open the session_log file.""" if mode == "append": self.session_log = open(filename, mode="ab") else: self.session_log = open(filename, mode="wb") self._session_log_close = True
python
def open_session_log(self, filename, mode="write"): """Open the session_log file.""" if mode == "append": self.session_log = open(filename, mode="ab") else: self.session_log = open(filename, mode="wb") self._session_log_close = True
[ "def", "open_session_log", "(", "self", ",", "filename", ",", "mode", "=", "\"write\"", ")", ":", "if", "mode", "==", "\"append\"", ":", "self", ".", "session_log", "=", "open", "(", "filename", ",", "mode", "=", "\"ab\"", ")", "else", ":", "self", "."...
Open the session_log file.
[ "Open", "the", "session_log", "file", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/base_connection.py#L1695-L1701
train
Open the session_log file.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/base_connection.py
BaseConnection.close_session_log
def close_session_log(self): """Close the session_log file (if it is a file that we opened).""" if self.session_log is not None and self._session_log_close: self.session_log.close() self.session_log = None
python
def close_session_log(self): """Close the session_log file (if it is a file that we opened).""" if self.session_log is not None and self._session_log_close: self.session_log.close() self.session_log = None
[ "def", "close_session_log", "(", "self", ")", ":", "if", "self", ".", "session_log", "is", "not", "None", "and", "self", ".", "_session_log_close", ":", "self", ".", "session_log", ".", "close", "(", ")", "self", ".", "session_log", "=", "None" ]
Close the session_log file (if it is a file that we opened).
[ "Close", "the", "session_log", "file", "(", "if", "it", "is", "a", "file", "that", "we", "opened", ")", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/base_connection.py#L1703-L1707
train
Close the session log file if it is a file that we opened.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/ipinfusion/ipinfusion_ocnos.py
IpInfusionOcNOSBase.save_config
def save_config(self, cmd="write", confirm=False, confirm_response=""): """Saves Config Using write command""" return super(IpInfusionOcNOSBase, self).save_config( cmd=cmd, confirm=confirm, confirm_response=confirm_response )
python
def save_config(self, cmd="write", confirm=False, confirm_response=""): """Saves Config Using write command""" return super(IpInfusionOcNOSBase, self).save_config( cmd=cmd, confirm=confirm, confirm_response=confirm_response )
[ "def", "save_config", "(", "self", ",", "cmd", "=", "\"write\"", ",", "confirm", "=", "False", ",", "confirm_response", "=", "\"\"", ")", ":", "return", "super", "(", "IpInfusionOcNOSBase", ",", "self", ")", ".", "save_config", "(", "cmd", "=", "cmd", ",...
Saves Config Using write command
[ "Saves", "Config", "Using", "write", "command" ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/ipinfusion/ipinfusion_ocnos.py#L24-L28
train
Saves Config Using write command
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/ipinfusion/ipinfusion_ocnos.py
IpInfusionOcNOSTelnet._process_option
def _process_option(self, tsocket, command, option): """ For all telnet options, re-implement the default telnetlib behaviour and refuse to handle any options. If the server expresses interest in 'terminal type' option, then reply back with 'xterm' terminal type. """ if c...
python
def _process_option(self, tsocket, command, option): """ For all telnet options, re-implement the default telnetlib behaviour and refuse to handle any options. If the server expresses interest in 'terminal type' option, then reply back with 'xterm' terminal type. """ if c...
[ "def", "_process_option", "(", "self", ",", "tsocket", ",", "command", ",", "option", ")", ":", "if", "command", "==", "DO", "and", "option", "==", "TTYPE", ":", "tsocket", ".", "sendall", "(", "IAC", "+", "WILL", "+", "TTYPE", ")", "tsocket", ".", "...
For all telnet options, re-implement the default telnetlib behaviour and refuse to handle any options. If the server expresses interest in 'terminal type' option, then reply back with 'xterm' terminal type.
[ "For", "all", "telnet", "options", "re", "-", "implement", "the", "default", "telnetlib", "behaviour", "and", "refuse", "to", "handle", "any", "options", ".", "If", "the", "server", "expresses", "interest", "in", "terminal", "type", "option", "then", "reply", ...
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/ipinfusion/ipinfusion_ocnos.py#L40-L52
train
Process a Telnet option.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/fortinet/fortinet_ssh.py
FortinetSSH.disable_paging
def disable_paging(self, delay_factor=1): """Disable paging is only available with specific roles so it may fail.""" check_command = "get system status | grep Virtual" output = self.send_command_timing(check_command) self.allow_disable_global = True self.vdoms = False sel...
python
def disable_paging(self, delay_factor=1): """Disable paging is only available with specific roles so it may fail.""" check_command = "get system status | grep Virtual" output = self.send_command_timing(check_command) self.allow_disable_global = True self.vdoms = False sel...
[ "def", "disable_paging", "(", "self", ",", "delay_factor", "=", "1", ")", ":", "check_command", "=", "\"get system status | grep Virtual\"", "output", "=", "self", ".", "send_command_timing", "(", "check_command", ")", "self", ".", "allow_disable_global", "=", "True...
Disable paging is only available with specific roles so it may fail.
[ "Disable", "paging", "is", "only", "available", "with", "specific", "roles", "so", "it", "may", "fail", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/fortinet/fortinet_ssh.py#L27-L62
train
Disable paging for the current locale.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/fortinet/fortinet_ssh.py
FortinetSSH._retrieve_output_mode
def _retrieve_output_mode(self): """Save the state of the output mode so it can be reset at the end of the session.""" reg_mode = re.compile(r"output\s+:\s+(?P<mode>.*)\s+\n") output = self.send_command("get system console") result_mode_re = reg_mode.search(output) if result_mode...
python
def _retrieve_output_mode(self): """Save the state of the output mode so it can be reset at the end of the session.""" reg_mode = re.compile(r"output\s+:\s+(?P<mode>.*)\s+\n") output = self.send_command("get system console") result_mode_re = reg_mode.search(output) if result_mode...
[ "def", "_retrieve_output_mode", "(", "self", ")", ":", "reg_mode", "=", "re", ".", "compile", "(", "r\"output\\s+:\\s+(?P<mode>.*)\\s+\\n\"", ")", "output", "=", "self", ".", "send_command", "(", "\"get system console\"", ")", "result_mode_re", "=", "reg_mode", ".",...
Save the state of the output mode so it can be reset at the end of the session.
[ "Save", "the", "state", "of", "the", "output", "mode", "so", "it", "can", "be", "reset", "at", "the", "end", "of", "the", "session", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/fortinet/fortinet_ssh.py#L64-L72
train
Retrieve the state of the output mode so it can be reset at the end of the session.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/fortinet/fortinet_ssh.py
FortinetSSH.cleanup
def cleanup(self): """Re-enable paging globally.""" if self.allow_disable_global: # Return paging state output_mode_cmd = "set output {}".format(self._output_mode) enable_paging_commands = ["config system console", output_mode_cmd, "end"] if self.vdoms: ...
python
def cleanup(self): """Re-enable paging globally.""" if self.allow_disable_global: # Return paging state output_mode_cmd = "set output {}".format(self._output_mode) enable_paging_commands = ["config system console", output_mode_cmd, "end"] if self.vdoms: ...
[ "def", "cleanup", "(", "self", ")", ":", "if", "self", ".", "allow_disable_global", ":", "# Return paging state", "output_mode_cmd", "=", "\"set output {}\"", ".", "format", "(", "self", ".", "_output_mode", ")", "enable_paging_commands", "=", "[", "\"config system ...
Re-enable paging globally.
[ "Re", "-", "enable", "paging", "globally", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/fortinet/fortinet_ssh.py#L74-L84
train
Re - enable paging globally.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/accedian/accedian_ssh.py
AccedianSSH.set_base_prompt
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, ...
python
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, ...
[ "def", "set_base_prompt", "(", "self", ",", "pri_prompt_terminator", "=", "\":\"", ",", "alt_prompt_terminator", "=", "\"#\"", ",", "delay_factor", "=", "2", ")", ":", "super", "(", "AccedianSSH", ",", "self", ")", ".", "set_base_prompt", "(", "pri_prompt_termin...
Sets self.base_prompt: used as delimiter for stripping of trailing prompt in output.
[ "Sets", "self", ".", "base_prompt", ":", "used", "as", "delimiter", "for", "stripping", "of", "trailing", "prompt", "in", "output", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/accedian/accedian_ssh.py#L35-L44
train
Sets self. base_prompt to used as delimiter for stripping of trailing prompt in output.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/hp/hp_procurve.py
HPProcurveBase.session_preparation
def session_preparation(self): """ Prepare the session after the connection has been established. Procurve uses - 'Press any key to continue' """ delay_factor = self.select_delay_factor(delay_factor=0) output = "" count = 1 while count <= 30: o...
python
def session_preparation(self): """ Prepare the session after the connection has been established. Procurve uses - 'Press any key to continue' """ delay_factor = self.select_delay_factor(delay_factor=0) output = "" count = 1 while count <= 30: o...
[ "def", "session_preparation", "(", "self", ")", ":", "delay_factor", "=", "self", ".", "select_delay_factor", "(", "delay_factor", "=", "0", ")", "output", "=", "\"\"", "count", "=", "1", "while", "count", "<=", "30", ":", "output", "+=", "self", ".", "r...
Prepare the session after the connection has been established. Procurve uses - 'Press any key to continue'
[ "Prepare", "the", "session", "after", "the", "connection", "has", "been", "established", ".", "Procurve", "uses", "-", "Press", "any", "key", "to", "continue" ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/hp/hp_procurve.py#L11-L41
train
This method is called by the session_open method. It is called by the session_close method.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/hp/hp_procurve.py
HPProcurveBase.enable
def enable( self, cmd="enable", pattern="password", re_flags=re.IGNORECASE, default_username="manager", ): """Enter enable mode""" if self.check_enable_mode(): return "" output = self.send_command_timing(cmd) if ( "usern...
python
def enable( self, cmd="enable", pattern="password", re_flags=re.IGNORECASE, default_username="manager", ): """Enter enable mode""" if self.check_enable_mode(): return "" output = self.send_command_timing(cmd) if ( "usern...
[ "def", "enable", "(", "self", ",", "cmd", "=", "\"enable\"", ",", "pattern", "=", "\"password\"", ",", "re_flags", "=", "re", ".", "IGNORECASE", ",", "default_username", "=", "\"manager\"", ",", ")", ":", "if", "self", ".", "check_enable_mode", "(", ")", ...
Enter enable mode
[ "Enter", "enable", "mode" ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/hp/hp_procurve.py#L43-L64
train
Enter enable mode.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/hp/hp_procurve.py
HPProcurveBase.cleanup
def cleanup(self): """Gracefully exit the SSH session.""" self.exit_config_mode() self.write_channel("logout" + self.RETURN) count = 0 while count <= 5: time.sleep(0.5) output = self.read_channel() if "Do you want to log out" in output: ...
python
def cleanup(self): """Gracefully exit the SSH session.""" self.exit_config_mode() self.write_channel("logout" + self.RETURN) count = 0 while count <= 5: time.sleep(0.5) output = self.read_channel() if "Do you want to log out" in output: ...
[ "def", "cleanup", "(", "self", ")", ":", "self", ".", "exit_config_mode", "(", ")", "self", ".", "write_channel", "(", "\"logout\"", "+", "self", ".", "RETURN", ")", "count", "=", "0", "while", "count", "<=", "5", ":", "time", ".", "sleep", "(", "0.5...
Gracefully exit the SSH session.
[ "Gracefully", "exit", "the", "SSH", "session", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/hp/hp_procurve.py#L66-L86
train
Gracefully exit the SSH session.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/hp/hp_procurve.py
HPProcurveBase.save_config
def save_config(self, cmd="write memory", confirm=False, confirm_response=""): """Save Config.""" return super(HPProcurveBase, self).save_config( cmd=cmd, confirm=confirm, confirm_response=confirm_response )
python
def save_config(self, cmd="write memory", confirm=False, confirm_response=""): """Save Config.""" return super(HPProcurveBase, self).save_config( cmd=cmd, confirm=confirm, confirm_response=confirm_response )
[ "def", "save_config", "(", "self", ",", "cmd", "=", "\"write memory\"", ",", "confirm", "=", "False", ",", "confirm_response", "=", "\"\"", ")", ":", "return", "super", "(", "HPProcurveBase", ",", "self", ")", ".", "save_config", "(", "cmd", "=", "cmd", ...
Save Config.
[ "Save", "Config", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/hp/hp_procurve.py#L88-L92
train
Save Config.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/hp/hp_procurve.py
HPProcurveTelnet.telnet_login
def telnet_login( self, pri_prompt_terminator="#", alt_prompt_terminator=">", username_pattern=r"Login Name:", pwd_pattern=r"assword", delay_factor=1, max_loops=60, ): """Telnet login: can be username/password or just password.""" super(HPProcu...
python
def telnet_login( self, pri_prompt_terminator="#", alt_prompt_terminator=">", username_pattern=r"Login Name:", pwd_pattern=r"assword", delay_factor=1, max_loops=60, ): """Telnet login: can be username/password or just password.""" super(HPProcu...
[ "def", "telnet_login", "(", "self", ",", "pri_prompt_terminator", "=", "\"#\"", ",", "alt_prompt_terminator", "=", "\">\"", ",", "username_pattern", "=", "r\"Login Name:\"", ",", "pwd_pattern", "=", "r\"assword\"", ",", "delay_factor", "=", "1", ",", "max_loops", ...
Telnet login: can be username/password or just password.
[ "Telnet", "login", ":", "can", "be", "username", "/", "password", "or", "just", "password", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/hp/hp_procurve.py#L100-L117
train
Telnet login.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/f5/f5_tmsh_ssh.py
F5TmshSSH.session_preparation
def session_preparation(self): """Prepare the session after the connection has been established.""" self._test_channel_read() self.set_base_prompt() self.tmsh_mode() self.set_base_prompt() self.disable_paging( command="modify cli preference pager disabled disp...
python
def session_preparation(self): """Prepare the session after the connection has been established.""" self._test_channel_read() self.set_base_prompt() self.tmsh_mode() self.set_base_prompt() self.disable_paging( command="modify cli preference pager disabled disp...
[ "def", "session_preparation", "(", "self", ")", ":", "self", ".", "_test_channel_read", "(", ")", "self", ".", "set_base_prompt", "(", ")", "self", ".", "tmsh_mode", "(", ")", "self", ".", "set_base_prompt", "(", ")", "self", ".", "disable_paging", "(", "c...
Prepare the session after the connection has been established.
[ "Prepare", "the", "session", "after", "the", "connection", "has", "been", "established", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/f5/f5_tmsh_ssh.py#L7-L18
train
Prepare the session after the connection has been established.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/f5/f5_tmsh_ssh.py
F5TmshSSH.tmsh_mode
def tmsh_mode(self, delay_factor=1): """tmsh command is equivalent to config command on F5.""" delay_factor = self.select_delay_factor(delay_factor) self.clear_buffer() command = "{}tmsh{}".format(self.RETURN, self.RETURN) self.write_channel(command) time.sleep(1 * delay_...
python
def tmsh_mode(self, delay_factor=1): """tmsh command is equivalent to config command on F5.""" delay_factor = self.select_delay_factor(delay_factor) self.clear_buffer() command = "{}tmsh{}".format(self.RETURN, self.RETURN) self.write_channel(command) time.sleep(1 * delay_...
[ "def", "tmsh_mode", "(", "self", ",", "delay_factor", "=", "1", ")", ":", "delay_factor", "=", "self", ".", "select_delay_factor", "(", "delay_factor", ")", "self", ".", "clear_buffer", "(", ")", "command", "=", "\"{}tmsh{}\"", ".", "format", "(", "self", ...
tmsh command is equivalent to config command on F5.
[ "tmsh", "command", "is", "equivalent", "to", "config", "command", "on", "F5", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/f5/f5_tmsh_ssh.py#L20-L28
train
tmsh command is equivalent to config command on F5.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/linux/linux_ssh.py
LinuxSSH.set_base_prompt
def set_base_prompt( self, pri_prompt_terminator="$", alt_prompt_terminator="#", delay_factor=1 ): """Determine base prompt.""" return super(LinuxSSH, self).set_base_prompt( pri_prompt_terminator=pri_prompt_terminator, alt_prompt_terminator=alt_prompt_terminator, ...
python
def set_base_prompt( self, pri_prompt_terminator="$", alt_prompt_terminator="#", delay_factor=1 ): """Determine base prompt.""" return super(LinuxSSH, self).set_base_prompt( pri_prompt_terminator=pri_prompt_terminator, alt_prompt_terminator=alt_prompt_terminator, ...
[ "def", "set_base_prompt", "(", "self", ",", "pri_prompt_terminator", "=", "\"$\"", ",", "alt_prompt_terminator", "=", "\"#\"", ",", "delay_factor", "=", "1", ")", ":", "return", "super", "(", "LinuxSSH", ",", "self", ")", ".", "set_base_prompt", "(", "pri_prom...
Determine base prompt.
[ "Determine", "base", "prompt", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/linux/linux_ssh.py#L30-L38
train
Determine base prompt.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/linux/linux_ssh.py
LinuxSSH.send_config_set
def send_config_set(self, config_commands=None, exit_config_mode=True, **kwargs): """Can't exit from root (if root)""" if self.username == "root": exit_config_mode = False return super(LinuxSSH, self).send_config_set( config_commands=config_commands, exit_config_mode=exit...
python
def send_config_set(self, config_commands=None, exit_config_mode=True, **kwargs): """Can't exit from root (if root)""" if self.username == "root": exit_config_mode = False return super(LinuxSSH, self).send_config_set( config_commands=config_commands, exit_config_mode=exit...
[ "def", "send_config_set", "(", "self", ",", "config_commands", "=", "None", ",", "exit_config_mode", "=", "True", ",", "*", "*", "kwargs", ")", ":", "if", "self", ".", "username", "==", "\"root\"", ":", "exit_config_mode", "=", "False", "return", "super", ...
Can't exit from root (if root)
[ "Can", "t", "exit", "from", "root", "(", "if", "root", ")" ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/linux/linux_ssh.py#L40-L46
train
Send config commands to LinuxSSH server.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/linux/linux_ssh.py
LinuxSSH.exit_enable_mode
def exit_enable_mode(self, exit_command="exit"): """Exit enable mode.""" delay_factor = self.select_delay_factor(delay_factor=0) output = "" if self.check_enable_mode(): self.write_channel(self.normalize_cmd(exit_command)) time.sleep(0.3 * delay_factor) ...
python
def exit_enable_mode(self, exit_command="exit"): """Exit enable mode.""" delay_factor = self.select_delay_factor(delay_factor=0) output = "" if self.check_enable_mode(): self.write_channel(self.normalize_cmd(exit_command)) time.sleep(0.3 * delay_factor) ...
[ "def", "exit_enable_mode", "(", "self", ",", "exit_command", "=", "\"exit\"", ")", ":", "delay_factor", "=", "self", ".", "select_delay_factor", "(", "delay_factor", "=", "0", ")", "output", "=", "\"\"", "if", "self", ".", "check_enable_mode", "(", ")", ":",...
Exit enable mode.
[ "Exit", "enable", "mode", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/linux/linux_ssh.py#L63-L73
train
Exit enable mode.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/linux/linux_ssh.py
LinuxSSH.enable
def enable(self, cmd="sudo su", pattern="ssword", re_flags=re.IGNORECASE): """Attempt to become root.""" delay_factor = self.select_delay_factor(delay_factor=0) output = "" if not self.check_enable_mode(): self.write_channel(self.normalize_cmd(cmd)) time.sleep(0.3...
python
def enable(self, cmd="sudo su", pattern="ssword", re_flags=re.IGNORECASE): """Attempt to become root.""" delay_factor = self.select_delay_factor(delay_factor=0) output = "" if not self.check_enable_mode(): self.write_channel(self.normalize_cmd(cmd)) time.sleep(0.3...
[ "def", "enable", "(", "self", ",", "cmd", "=", "\"sudo su\"", ",", "pattern", "=", "\"ssword\"", ",", "re_flags", "=", "re", ".", "IGNORECASE", ")", ":", "delay_factor", "=", "self", ".", "select_delay_factor", "(", "delay_factor", "=", "0", ")", "output",...
Attempt to become root.
[ "Attempt", "to", "become", "root", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/linux/linux_ssh.py#L75-L97
train
Attempt to become root.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/linux/linux_ssh.py
LinuxFileTransfer.remote_file_size
def remote_file_size(self, remote_cmd="", remote_file=None): """Get the file size of the remote file.""" return self._remote_file_size_unix( remote_cmd=remote_cmd, remote_file=remote_file )
python
def remote_file_size(self, remote_cmd="", remote_file=None): """Get the file size of the remote file.""" return self._remote_file_size_unix( remote_cmd=remote_cmd, remote_file=remote_file )
[ "def", "remote_file_size", "(", "self", ",", "remote_cmd", "=", "\"\"", ",", "remote_file", "=", "None", ")", ":", "return", "self", ".", "_remote_file_size_unix", "(", "remote_cmd", "=", "remote_cmd", ",", "remote_file", "=", "remote_file", ")" ]
Get the file size of the remote file.
[ "Get", "the", "file", "size", "of", "the", "remote", "file", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/linux/linux_ssh.py#L135-L139
train
Get the file size of the remote file.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/scp_functions.py
file_transfer
def file_transfer( ssh_conn, source_file, dest_file, file_system=None, direction="put", disable_md5=False, inline_transfer=False, overwrite_file=False, ): """Use Secure Copy or Inline (IOS-only) to transfer files to/from network devices. inline_transfer ONLY SUPPORTS TEXT FILES ...
python
def file_transfer( ssh_conn, source_file, dest_file, file_system=None, direction="put", disable_md5=False, inline_transfer=False, overwrite_file=False, ): """Use Secure Copy or Inline (IOS-only) to transfer files to/from network devices. inline_transfer ONLY SUPPORTS TEXT FILES ...
[ "def", "file_transfer", "(", "ssh_conn", ",", "source_file", ",", "dest_file", ",", "file_system", "=", "None", ",", "direction", "=", "\"put\"", ",", "disable_md5", "=", "False", ",", "inline_transfer", "=", "False", ",", "overwrite_file", "=", "False", ",", ...
Use Secure Copy or Inline (IOS-only) to transfer files to/from network devices. inline_transfer ONLY SUPPORTS TEXT FILES and will not support binary file transfers. return { 'file_exists': boolean, 'file_transferred': boolean, 'file_verified': boolean, }
[ "Use", "Secure", "Copy", "or", "Inline", "(", "IOS", "-", "only", ")", "to", "transfer", "files", "to", "/", "from", "network", "devices", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/scp_functions.py#L23-L112
train
Use Secure Copy or Inline to transfer files to network devices.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/alcatel/alcatel_sros_ssh.py
AlcatelSrosSSH.set_base_prompt
def set_base_prompt(self, *args, **kwargs): """Remove the > when navigating into the different config level.""" cur_base_prompt = super(AlcatelSrosSSH, self).set_base_prompt(*args, **kwargs) match = re.search(r"(.*)(>.*)*#", cur_base_prompt) if match: # strip off >... from ba...
python
def set_base_prompt(self, *args, **kwargs): """Remove the > when navigating into the different config level.""" cur_base_prompt = super(AlcatelSrosSSH, self).set_base_prompt(*args, **kwargs) match = re.search(r"(.*)(>.*)*#", cur_base_prompt) if match: # strip off >... from ba...
[ "def", "set_base_prompt", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "cur_base_prompt", "=", "super", "(", "AlcatelSrosSSH", ",", "self", ")", ".", "set_base_prompt", "(", "*", "args", ",", "*", "*", "kwargs", ")", "match", "=", ...
Remove the > when navigating into the different config level.
[ "Remove", "the", ">", "when", "navigating", "into", "the", "different", "config", "level", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/alcatel/alcatel_sros_ssh.py#L20-L27
train
Remove the > when navigating into the different config level.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/alcatel/alcatel_sros_ssh.py
AlcatelSrosSSH.enable
def enable(self, cmd="enable-admin", pattern="ssword", re_flags=re.IGNORECASE): """Enter enable mode.""" return super(AlcatelSrosSSH, self).enable( cmd=cmd, pattern=pattern, re_flags=re_flags )
python
def enable(self, cmd="enable-admin", pattern="ssword", re_flags=re.IGNORECASE): """Enter enable mode.""" return super(AlcatelSrosSSH, self).enable( cmd=cmd, pattern=pattern, re_flags=re_flags )
[ "def", "enable", "(", "self", ",", "cmd", "=", "\"enable-admin\"", ",", "pattern", "=", "\"ssword\"", ",", "re_flags", "=", "re", ".", "IGNORECASE", ")", ":", "return", "super", "(", "AlcatelSrosSSH", ",", "self", ")", ".", "enable", "(", "cmd", "=", "...
Enter enable mode.
[ "Enter", "enable", "mode", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/alcatel/alcatel_sros_ssh.py#L29-L33
train
Enter enable mode.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/alcatel/alcatel_sros_ssh.py
AlcatelSrosSSH.check_enable_mode
def check_enable_mode(self, check_string="CLI Already in admin mode"): """Check whether we are in enable-admin mode. SROS requires us to do this: *A:HOSTNAME# enable-admin MINOR: CLI Already in admin mode. *A:HOSTNAME# *A:HOSTNAME# enable-admin Password: ...
python
def check_enable_mode(self, check_string="CLI Already in admin mode"): """Check whether we are in enable-admin mode. SROS requires us to do this: *A:HOSTNAME# enable-admin MINOR: CLI Already in admin mode. *A:HOSTNAME# *A:HOSTNAME# enable-admin Password: ...
[ "def", "check_enable_mode", "(", "self", ",", "check_string", "=", "\"CLI Already in admin mode\"", ")", ":", "output", "=", "self", ".", "send_command_timing", "(", "\"enable-admin\"", ")", "if", "re", ".", "search", "(", "r\"ssword\"", ",", "output", ")", ":",...
Check whether we are in enable-admin mode. SROS requires us to do this: *A:HOSTNAME# enable-admin MINOR: CLI Already in admin mode. *A:HOSTNAME# *A:HOSTNAME# enable-admin Password: MINOR: CLI Invalid password. *A:HOSTNAME#
[ "Check", "whether", "we", "are", "in", "enable", "-", "admin", "mode", ".", "SROS", "requires", "us", "to", "do", "this", ":", "*", "A", ":", "HOSTNAME#", "enable", "-", "admin", "MINOR", ":", "CLI", "Already", "in", "admin", "mode", ".", "*", "A", ...
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/alcatel/alcatel_sros_ssh.py#L35-L54
train
Check whether we are in enable - admin mode.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
ktbyers/netmiko
netmiko/alcatel/alcatel_sros_ssh.py
AlcatelSrosSSH.config_mode
def config_mode(self, config_command="configure", pattern="#"): """ Enter into configuration mode on SROS device.""" return super(AlcatelSrosSSH, self).config_mode( config_command=config_command, pattern=pattern )
python
def config_mode(self, config_command="configure", pattern="#"): """ Enter into configuration mode on SROS device.""" return super(AlcatelSrosSSH, self).config_mode( config_command=config_command, pattern=pattern )
[ "def", "config_mode", "(", "self", ",", "config_command", "=", "\"configure\"", ",", "pattern", "=", "\"#\"", ")", ":", "return", "super", "(", "AlcatelSrosSSH", ",", "self", ")", ".", "config_mode", "(", "config_command", "=", "config_command", ",", "pattern"...
Enter into configuration mode on SROS device.
[ "Enter", "into", "configuration", "mode", "on", "SROS", "device", "." ]
54e6116c0b4664de2123081937e0a9a27bdfdfea
https://github.com/ktbyers/netmiko/blob/54e6116c0b4664de2123081937e0a9a27bdfdfea/netmiko/alcatel/alcatel_sros_ssh.py#L60-L64
train
Enter into configuration mode on SROS device.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...