Closed bpastravanu closed 2 years ago
Someone would probably need to do a PR on the A-10 driver.
I don't really no what is going on with all those *
characters in the session log that is a bit odd.
Items I see that might be an issue:
Also your exception message doesn't match up with your session_log. Your exception indicates failure on send_confg_from_file whereas your session_log looks like it went all the way to the disconnect() call.
Thanks for the quick turnaround Kirk. For
if "sure" in output: output += net_connect.send_comand("Y")
By enabling logging of reads and writes of the communications channel, I can see the same behaviour as in the logs previously captured, config is being sent.
DEBUG:netmiko:Pattern found: (?:vThunder(NOLICENSE)|#) Building configuration... Write configuration to default primary startup-config [OK] vThunder(config-slb vserver-vport)(NOLICENSE)# DEBUG:netmiko:write_channel: b'!\n' DEBUG:netmiko:Pattern is: ! DEBUG:netmiko:_read_channel_expect read_data: ! vThunder(config-slb vserver-vport)(NOLICENSE)# DEBUG:netmiko:Pattern found: ! ! vThunder(config-slb vserver-vport)(NOLICENSE)# DEBUG:netmiko:write_channel: b'end\n' DEBUG:netmiko:Pattern is: end DEBUG:netmiko:_read_channel_expect read_data: end vThunder(NOLICENSE)# DEBUG:netmiko:Pattern found: end end vThunder(NOLICENSE)# DEBUG:netmiko:write_channel: b'exit\n' DEBUG:netmiko:Pattern is: exit DEBUG:netmiko:_read_channel_expect read_data: exit vThunder(NOLICENSE)> DEBUG:netmiko:Pattern found: exit exit vThunder(NOLICENSE)> DEBUG:netmiko:write_channel: b'exit\n' DEBUG:netmiko:Pattern is: exit DEBUG:netmiko:_read_channel_expect read_data: e DEBUG:netmiko:_read_channel_expect read_data: xit Are you sure to quit (N/Y)?: DEBUG:netmiko:Pattern found: exit exit Are you sure to quit (N/Y)?: DEBUG:netmiko:Pattern is: (?:vThunder(NOLICENSE)|#)
Hi, I'm interested to get the final solution to this issue, I have similar errors and wish to get alternative solutions to my scrip that configures a login banner on multiple cisco devices.
Hi, no solution yet. @ktbyers , how can I do that PR on the A10 driver?
@sbo-7455 @bpastravanu Is anyone still working on this? If I create a fix for it, is someone available/willing to test it?
If anyone has an A10 device and is willing to test a fix, just let me know and I can re-open this issue.
I am running bellow, and the config is being pushed to the device, but I still get some timeout errors back:
!/usr/bin/env python
from netmiko import Netmiko from getpass import getpass from netmiko.a10 import A10SSH
a10_lab = { "host": "172.16..131.200", "username": "admin", "password": "a10", "device_type": "a10", "secret": " ", "session_log": ".../session_log.txt", }
cfg_file = ".../config_changes.txt" net_connect = Netmiko(**a10_lab) net_connect.enable()
print() print(net_connect.find_prompt())
output = net_connect.send_config_from_file(cfg_file) print(output) print()
net_connect.save_config() net_connect.disconnect()
Exceptions bellow:
Traceback (most recent call last): File "/home/boddo0504/.local/lib/python3.6/site-packages/paramiko/channel.py", line 699, in recv out = self.in_buffer.read(nbytes, self.timeout) File "/home/boddo0504/.local/lib/python3.6/site-packages/paramiko/buffered_pipe.py", line 164, in read raise PipeTimeout() paramiko.buffered_pipe.PipeTimeout During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/boddo0504/.local/lib/python3.6/site-packages/netmiko/base_connection.py", line 550, in _read_channel_expect new_data = self.remote_conn.recv(MAX_BUFFER) File "/home/boddo0504/.local/lib/python3.6/site-packages/paramiko/channel.py", line 701, in recv raise socket.timeout() socket.timeout During handling of the above exception, another exception occurred: Traceback (most recent call last): File "a10_config_change.py", line 34, in
output = net_connect.send_config_from_file(cfg_file)
File "/home/boddo0504/.local/lib/python3.6/site-packages/netmiko/base_connection.py", line 1665, in send_config_from_file
return self.send_config_set(cfg_file, *kwargs)
File "/home/boddo0504/.local/lib/python3.6/site-packages/netmiko/base_connection.py", line 1759, in send_config_set
new_output = self.read_until_pattern(pattern=pattern)
File "/home/boddo0504/.local/lib/python3.6/site-packages/netmiko/base_connection.py", line 627, in read_until_pattern
return self._read_channel_expect(args, **kwargs)
File "/home/boddo0504/.local/lib/python3.6/site-packages/netmiko/base_connection.py", line 561, in _read_channel_expect
"Timed-out reading channel, data not available."
netmiko.ssh_exception.NetmikoTimeoutException: Timed-out reading channel, data not available.