Juniper driver fails due to apparent CLI change

Bug #1903891 reported by Doug Szumski on 2020-11-11
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Networking ML2 Generic Switch
Undecided
Unassigned

Bug Description

It appears that on JUNOS 18.4R2-S2.4 built 2019-11-08 the word `interface` as part of the CLI has changed to `interfaces`. The CLI automatically adds the additional `s`, for example, `delete interface {port} disable` is converted to `delete interfaces {port} disable`. However, this causes a terrible failure in netmiko such as:

`
2020-11-11 11:21:50.864 24 ERROR neutron.plugins.ml2.managers [req-697e4bd8-6585-4943-adb3-310681c9e886 a6f6abb4b7034092bc36704c69124611 0269b0c34de84c61a722c
3ab1f68f44e - default default] Mechanism driver genericswitch failed in bind_port: networking_generic_switch.exceptions.GenericSwitchNetmikoConnectError: Netm
iko connection error: {'device_type': 'juniper', 'ip': '10.30.0.16', 'username': 'stack', 'password': '******'}, error: Timed-out reading channel, data not a
vailable.
2020-11-11 11:21:50.864 24 ERROR neutron.plugins.ml2.managers Traceback (most recent call last):
2020-11-11 11:21:50.864 24 ERROR neutron.plugins.ml2.managers File "/usr/lib/python3.6/site-packages/paramiko/channel.py", line 699, in recv
2020-11-11 11:21:50.864 24 ERROR neutron.plugins.ml2.managers out = self.in_buffer.read(nbytes, self.timeout)
2020-11-11 11:21:50.864 24 ERROR neutron.plugins.ml2.managers File "/usr/lib/python3.6/site-packages/paramiko/buffered_pipe.py", line 164, in read
2020-11-11 11:21:50.864 24 ERROR neutron.plugins.ml2.managers raise PipeTimeout()
2020-11-11 11:21:50.864 24 ERROR neutron.plugins.ml2.managers paramiko.buffered_pipe.PipeTimeout
2020-11-11 11:21:50.864 24 ERROR neutron.plugins.ml2.managers
2020-11-11 11:21:50.864 24 ERROR neutron.plugins.ml2.managers During handling of the above exception, another exception occurred:
2020-11-11 11:21:50.864 24 ERROR neutron.plugins.ml2.managers
2020-11-11 11:21:50.864 24 ERROR neutron.plugins.ml2.managers Traceback (most recent call last):
2020-11-11 11:21:50.864 24 ERROR neutron.plugins.ml2.managers File "/usr/lib/python3.6/site-packages/netmiko/base_connection.py", line 541, in _read_channel
_expect
2020-11-11 11:21:50.864 24 ERROR neutron.plugins.ml2.managers new_data = self.remote_conn.recv(MAX_BUFFER)
2020-11-11 11:21:50.864 24 ERROR neutron.plugins.ml2.managers File "/usr/lib/python3.6/site-packages/paramiko/channel.py", line 701, in recv
2020-11-11 11:21:50.864 24 ERROR neutron.plugins.ml2.managers raise socket.timeout()
2020-11-11 11:21:50.864 24 ERROR neutron.plugins.ml2.managers socket.timeout`

Upon inspection the commands are garbled:

`
(Pdb) config_commands
['delete interface xe-0/0/2:1 disable', 'delete interface xe-0/0/2:1 unit 0 family ethernet-switching vlan members', 'set interface xe-0/0/2:1 unit 0 family ethernet-switching vlan members 104']
(Pdb) n
> /usr/lib/python3.6/site-packages/netmiko/base_connection.py(1740)send_config_set()
-> output = self._sanitize_output(output)
(Pdb) output
'delete interface xe-0/0/2:1\r\n ^\r\nsyntax error.\r\n\rstack@c5-swtedg-01# delete interface xe-0/0/2:1 \x08\x08\x08\x08\x08\x08\
x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08dinterface xe-0/0/2:1\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x
08\x08\x08iinterface xe-0/0/2:1\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08sinterface xe-0/0/2:1\x08\x08\x08\x08\x08\x08\x
08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08ainterface xe-0/0/2:1\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08bin
terface xe-0/0/2:1\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08linterface xe-0/0/2:1\x08\x08\x08\x08\x08\x08\x08\x08\x08\x0
8\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08einterface xe-0/0/2:1\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\r\nerror: synta
x error: disableinterface\r\n\r\n{master:0}[edit]\r\nstack@c5-swtedg-01# delete interface xe-0/0/2:1\r\n ^\r\nsyntax error.\r\n\rsta
`

This can be fixed with `s/interface/interfaces` in the Juniper driver.

Doug Szumski (dszumski) on 2020-11-11
summary: - Juniper driver can't handle conversion of trunk ports
+ Juniper driver fails due to apparent CLI change
description: updated
Doug Szumski (dszumski) wrote :

Unfortunately it's not easy to find when this change occurred.

Changed in networking-generic-switch:
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers