Closed horseinthesky closed 6 years ago
Can you show me what this set of configuration changes looks like from the CLI (including entering/exiting config mode)?
It looks like it is failing on the exiting of config mode.
It actually does the configuration but raises an NetMikoTimeoutException
interface 100GE1/0/22:1
description \
port default vlan 333
stp edged-port enable
qos drr 0 to 5
qos queue 0 drr weight 20
qos queue 1 drr weight 75
qos queue 2 drr weight 5
mac-address notification learning
jumboframe enable 9712
#
The commands it does are
<cloud-test-man1-4s255>disp history-command all-users
User : admin, VTY3, 2A02:6B8:0:401:6016:C2A0:855A:FCA
Time : 2018-08-07 10:52:03+03:00 DST
Command: return
User : admin, VTY3, 2A02:6B8:0:401:6016:C2A0:855A:FCA
Time : 2018-08-07 10:51:58+03:00 DST
Command: commit
User : admin, VTY3, 2A02:6B8:0:401:6016:C2A0:855A:FCA
Time : 2018-08-07 10:51:58+03:00 DST
Command: port default vlan 333
User : admin, VTY3, 2A02:6B8:0:401:6016:C2A0:855A:FCA
Time : 2018-08-07 10:51:58+03:00 DST
Command: port link-type access
User : admin, VTY3, 2A02:6B8:0:401:6016:C2A0:855A:FCA
Time : 2018-08-07 10:51:58+03:00 DST
Command: interface 100ge1/0/22:1
User : admin, VTY3, 2A02:6B8:0:401:6016:C2A0:855A:FCA
Time : 2018-08-07 10:51:56+03:00 DST
Command: system-view
I've noticed that Netmiko 2.1.1 does
User : admin, VTY3, 2A02:6B8:0:401:6016:C2A0:855A:FCA
Time : 2018-08-07 10:55:12+03:00 DST
Command: screen-length 0 temporary
before system-view
and Netmiko 2.2.2 does not.
@horseinthesky Yes, I need to see the actual CLI session of what this would look like (not the command history). Particularly I need to see what exiting system-view looks like from a CLI perspective.
Note, there were no direct changes in the Huawei driver between 2.1.1. and 2.2.2 so it is likely an underlying change in the base_connection.py that affected this:
https://github.com/ktbyers/netmiko/commits/develop/netmiko/huawei/huawei_ssh.py
I noticed the HP Comware driver does this for exit_config_mode:
37 def exit_config_mode(self, exit_config='return', pattern=r'>'):
38 """Exit config mode."""
39 return super(HPComwareBase, self).exit_config_mode(exit_config=exit_config,
40 pattern=pattern)
Whereas Huawei does this:
24 def exit_config_mode(self, exit_config='return'):
25 """Exit configuration mode."""
26 return super(HuaweiSSH, self).exit_config_mode(exit_config=exit_config)
I wonder if we just need to add that pattern=r'>
to fix this.
Should be able to tell from the CLI output for when you exit system-view.
Could you tell me how to get this info?
After exception raises a can see that prompt is:
In [2]: ssh.find_prompt()
Out[2]: '<cloud-test-man1-4s255>'
@horseinthesky Yes, I am just referring to SSHing into the device and repeating what you are trying to do programmatically, but doing it from the SSH session (and then posting it here).
It will probably be clear from this what is going wrong and what needs fixed in Netmiko.
@ktbyers If you tell me how to do it in more detail I will gladly do it.
I am not understanding your question? Just SSH into the device and manually execute the commands you were going to execute via the script?
Then copy and paste the entire SSH session here? Obfuscate anything that is confidential.
Here it is:
netinfra-rw@cloudvessel:~$ ssh cloud-test-man1-4s255.yndx.net
cloud-test-man1-4s255
Info: The max number of VTY users is 8, the number of current VTY users online is 1, and total number of terminal users online is 1.
The current login time is 2018-08-10 11:52:15+03:00 DST.
<cloud-test-man1-4s255>sy
Enter system view, return user view with return command.
[~cloud-test-man1-4s255]interface 100ge1/0/22:1
[~cloud-test-man1-4s255-100GE1/0/22:1]port link-type access
[*cloud-test-man1-4s255-100GE1/0/22:1]port default vlan 333
[*cloud-test-man1-4s255-100GE1/0/22:1]commit
[~cloud-test-man1-4s255-100GE1/0/22:1]
See fix submitted by @duckhawk. It should be in the develop
branch of Netmiko now. Let me know if this doesn't fix your issue.
This fixes the issue. Thank you and @duckhawk =)
I have a bunch of Huawei CE switched and after upgrading Netmiko to 2.2.2 version it can not configure them.
btw display commands work
Version 2.1.1 works perfectly fine: