You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Value PORT (\S+)
Value NAME (.*?)
Value STATUS (\S+)
Value VLAN (\d+|routed|trunk|--)
Value DUPLEX (\S+)
Value SPEED (\S+)
Value TYPE (\S+|\S+\s+\S+)
Start
^${PORT}\s+${NAME}\s+${STATUS}\s+${VLAN}\s+${DUPLEX}\s+${SPEED}\s+${TYPE}\s*$$ -> Record
^[Pp]ort\s+[Nn]ame\s+[Ss]tatus\s+[Vv]lan\s+[Dd]uplex\s+[Ss]peed\s+[Tt]ype\s*$$
^-+\s*$$
^$$
^.*$$ -> Error
SAMPLE COMMAND OUTPUT
--------------------------------------------------------------------------------
Port Name Status Vlan Duplex Speed Type
--------------------------------------------------------------------------------
fc2/1 is up Port mode is NP
fc2/2 is up Port mode is NP
fc2/3 is up Port mode is NP
fc2/4 is up Port mode is NP
fc2/5 is down (SFP not present)
fc2/6 is down (SFP not present)
Eth1/1 XXXXXXX1_bond1_Act connected 111 full 1000 SFP-1000BAS
Eth1/2 XXXXXXX3_bond1_Act connected 112 full 1000 SFP-1000BAS
Eth1/3 YYYYYYYY1_ha1 connected 115 full 1000 SFP-1000BAS
Eth1/4 ZZZZZZZZZZZZZ1_tru connected trunk full 10G 10Gbase-SR
Eth1/5 ZZZZZZZZZZZZZ1_tru connected trunk full 10G 10Gbase-SR
Eth1/6 AAAAAAAAA1_po2 connected trunk full 1000 SFP-1000BAS
Eth1/7 BBBBBBBB10-1 connected 4093 full 10G Fabric Exte
Eth1/8 BBBBBBBB10-1 connected 4093 full 10G Fabric Exte
Eth1/9 BBBBBBBB11-1 connected 4093 full 10G Fabric Exte
Eth1/10 BBBBBBBB11-1 connected 4093 full 10G Fabric Exte
SUMMARY
Parsing fails when fc ports are present in output
STEPS TO REPRODUCE
nr=InitNornir(config_file='nr-inventory.yml')
result=nr.run(task=netmiko_send_command, command_string='show int status', use_textfsm=True)
print_result(result)
EXPECTED RESULTS
Parsing without errors. Info about fc ports is desirable, but not mandatory if it is hard to implement.
ACTUAL RESULTS
Host 'HHHHHHHHK3': task 'netmiko_send_command' failed with traceback:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/nornir/core/task.py", line 85, in start
r = self.task(self, **self.params)
File "/usr/local/lib/python3.6/site-packages/nornir/plugins/tasks/networking/netmiko_send_command.py", line 32, in netmiko_send_command
result = net_connect.send_command(command_string, **kwargs)
File "/usr/local/lib/python3.6/site-packages/netmiko/utilities.py", line 347, in wrapper_decorator
return func(self, *args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/netmiko/base_connection.py", line 1448, in send_command
template=textfsm_template,
File "/usr/local/lib/python3.6/site-packages/netmiko/utilities.py", line 280, in get_structured_data
return _textfsm_parse(textfsm_obj, raw_output, attrs)
File "/usr/local/lib/python3.6/site-packages/netmiko/utilities.py", line 252, in _textfsm_parse
textfsm_obj.ParseCmd(raw_output, attrs)
File "/usr/local/lib/python3.6/site-packages/netmiko/_textfsm/_clitable.py", line 272, in ParseCmd
self.table = self._ParseCmdItem(self.raw, template_file=template_files[0])
File "/usr/local/lib/python3.6/site-packages/netmiko/_textfsm/_clitable.py", line 303, in _ParseCmdItem
for record in fsm.ParseText(cmd_input):
File "/usr/local/lib/python3.6/site-packages/textfsm/parser.py", line 895, in ParseText
self._CheckLine(line)
File "/usr/local/lib/python3.6/site-packages/textfsm/parser.py", line 944, in _CheckLine
if self._Operations(rule, line):
File "/usr/local/lib/python3.6/site-packages/textfsm/parser.py", line 1025, in _Operations
% (rule.line_num, line))
textfsm.parser.TextFSMError: State Error raised. Rule Line: 14. Input Line: fc2/1 is up Port mode is NP
netmiko_send_command************************************************************
* HHHHHHHHK3 ** changed : False ************************************************
vvvv netmiko_send_command ** changed : False vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv ERROR
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/nornir/core/task.py", line 85, in start
r = self.task(self, **self.params)
File "/usr/local/lib/python3.6/site-packages/nornir/plugins/tasks/networking/netmiko_send_command.py", line 32, in netmiko_send_command
result = net_connect.send_command(command_string, **kwargs)
File "/usr/local/lib/python3.6/site-packages/netmiko/utilities.py", line 347, in wrapper_decorator
return func(self, *args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/netmiko/base_connection.py", line 1448, in send_command
template=textfsm_template,
File "/usr/local/lib/python3.6/site-packages/netmiko/utilities.py", line 280, in get_structured_data
return _textfsm_parse(textfsm_obj, raw_output, attrs)
File "/usr/local/lib/python3.6/site-packages/netmiko/utilities.py", line 252, in _textfsm_parse
textfsm_obj.ParseCmd(raw_output, attrs)
File "/usr/local/lib/python3.6/site-packages/netmiko/_textfsm/_clitable.py", line 272, in ParseCmd
self.table = self._ParseCmdItem(self.raw, template_file=template_files[0])
File "/usr/local/lib/python3.6/site-packages/netmiko/_textfsm/_clitable.py", line 303, in _ParseCmdItem
for record in fsm.ParseText(cmd_input):
File "/usr/local/lib/python3.6/site-packages/textfsm/parser.py", line 895, in ParseText
self._CheckLine(line)
File "/usr/local/lib/python3.6/site-packages/textfsm/parser.py", line 944, in _CheckLine
if self._Operations(rule, line):
File "/usr/local/lib/python3.6/site-packages/textfsm/parser.py", line 1025, in _Operations
% (rule.line_num, line))
textfsm.parser.TextFSMError: State Error raised. Rule Line: 14. Input Line: fc2/1 is up Port mode is NP
^^^^ END netmiko_send_command ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The text was updated successfully, but these errors were encountered:
ISSUE TYPE
TEMPLATE USING
SAMPLE COMMAND OUTPUT
SUMMARY
Parsing fails when fc ports are present in output
STEPS TO REPRODUCE
EXPECTED RESULTS
Parsing without errors. Info about fc ports is desirable, but not mandatory if it is hard to implement.
ACTUAL RESULTS
The text was updated successfully, but these errors were encountered: