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 Required INTF (\S+)
Value LINK_STATUS (.+?)
Value PROTOCOL_STATUS (.+?)
Value List IPADDR (\S+?)
Value List MASK (\d*)
Value VRF (\S+)
Value MTU (\d+)
Value List IP_HELPER (\d+\.\d+\.\d+\.\d+)
Value OUTGOING_ACL (.*?)
Value INBOUND_ACL (.*?)
Start
^\S -> Continue.Record
^${INTF}\s+is\s+${LINK_STATUS},\s+line\s+protocol\s+is\s+${PROTOCOL_STATUS}\s*$$
^\s+Internet\s+address\s+is\s+${IPADDR}/?${MASK}\s*$$
^\s+Secondary\s+address\s+${IPADDR}/?${MASK}\s*$$
^.+VPN\s+Routing/Forwarding\s+"${VRF}"
^\s+MTU\s+is\s+${MTU}\s+bytes
^\s+Helper\s+address(es|)\s(is|are)\s+${IP_HELPER}\s*$$ -> HELPERS
^\s+Outgoing\s+(?:Common\s+)?access\s+list\s+is\s+not\s+set
^\s+Outgoing\s+(?:Common\s+)?access\s+list\s+is\s+${OUTGOING_ACL}\s*$$
^\s+Inbound\s+(?:Common\s+)?access\s+list\s+is\s+not\s+set
^\s+Inbound\s+(?:Common\s+)?access\s+list\s+is\s+${INBOUND_ACL}\s*$$
^\s+Internet\s+protocol
^\s+Interface\s+is\s+unnumbered
^\s+Broadcast
^\s+Multicast
^\s+2[2-5]\d\.
^\s+Address\s+determined
^\s+Directed
^\s+MTU
^\s+Helper
^\s+Directed
^\s+Outgoing
^\s+Inbound
^\s+.*Proxy
^\s+Security
^\s+Split
^\s+ICMP
^\s+IP\s+(?:fast|Flow|CEF|Null|multicast|route|output|access)
^\s+Associated
^\s+Topology
^\s+Router
^\s+TCP
^\s+RTP
^\s+Probe
^\s+Policy
^\s+Network\s+address\s+
^\s+BGP
^\s+(Input|Output|Post)\s+.*features
^\s+IPv4\s+WCCP
^\s*$$
^. -> Error
HELPERS
^\s+${IP_HELPER}\s*$$
^\s+Directed -> Start
^.* -> Error
SAMPLE COMMAND OUTPUT
Virtual-Access1 is up, line protocol is up
Internet protocol processing disabled
Virtual-Access2 is up, line protocol is up
Peer address is 10.1.1.1
Dialer interface is Dialer1
SUMMARY
The template file show_ip_interface for Cisco IOS does not cover all the possible options.
I did resolve this issue by adding, but not sure how you'd want to deal with this in the real code:
^\s+Peer address is (\d+\.\d+\.\d+\.\d+)
^\s+Dialer interface is Dialer(\d+)
STEPS TO REPRODUCE
output = """Virtual-Access1 is up, line protocol is upInternet protocol processing disabledVirtual-Access2 is up, line protocol is upPeer address is 10.1.1.1Dialer interface is Dialer1"""from ntc_templates.parse import parse_outputip_interface = parse_output(platform="cisco_ios", command="show ip interface", data=output)
EXPECTED RESULTS
Parsed object for the output of the command.
ACTUAL RESULTS
Peer Address Error:
Traceback (most recent call last):
File "repo.py", line 11, in <module>
ip_interface = parse_output(platform="cisco_ios", command="show ip interface", data=output)
File "C:\Users\ospeirs\AppData\Roaming\Python\Python37\site-packages\ntc_templates\parse.py", line 35, in parse_output
cli_table.ParseCmd(data, attrs)
File "C:\Users\ospeirs\AppData\Roaming\Python\Python37\site-packages\clitable.py", line 277, in ParseCmd
self.table = self._ParseCmdItem(self.raw, template_file=template_files[0])
File "C:\Users\ospeirs\AppData\Roaming\Python\Python37\site-packages\clitable.py", line 310, in _ParseCmdItem
for record in fsm.ParseText(cmd_input):
File "C:\Users\ospeirs\AppData\Roaming\Python\Python37\site-packages\textfsm.py", line 885, in ParseText
self._CheckLine(line)
File "C:\Users\ospeirs\AppData\Roaming\Python\Python37\site-packages\textfsm.py", line 908, in _CheckLine
if self._Operations(rule, line):
File "C:\Users\ospeirs\AppData\Roaming\Python\Python37\site-packages\textfsm.py", line 989, in _Operations
% (rule.line_num, line))
textfsm.TextFSMError: State Error raised. Rule Line: 54. Input Line: Peer address is 10.1.1.1
Dialer Error:
Traceback (most recent call last):
File ".\repo.py", line 10, in <module>
ip_interface = parse_output(platform="cisco_ios", command="sh ip int", data=output)
File "C:\Users\ospeirs\AppData\Roaming\Python\Python37\site-packages\ntc_templates\parse.py", line 35, in parse_output
cli_table.ParseCmd(data, attrs)
File "C:\Users\ospeirs\AppData\Roaming\Python\Python37\site-packages\clitable.py", line 277, in ParseCmd
self.table = self._ParseCmdItem(self.raw, template_file=template_files[0])
File "C:\Users\ospeirs\AppData\Roaming\Python\Python37\site-packages\clitable.py", line 310, in _ParseCmdItem
for record in fsm.ParseText(cmd_input):
File "C:\Users\ospeirs\AppData\Roaming\Python\Python37\site-packages\textfsm.py", line 885, in ParseText
self._CheckLine(line)
File "C:\Users\ospeirs\AppData\Roaming\Python\Python37\site-packages\textfsm.py", line 908, in _CheckLine
if self._Operations(rule, line):
File "C:\Users\ospeirs\AppData\Roaming\Python\Python37\site-packages\textfsm.py", line 989, in _Operations
% (rule.line_num, line))
textfsm.TextFSMError: State Error raised. Rule Line: 54. Input Line: Dialer interface is Dialer1
The text was updated successfully, but these errors were encountered:
ISSUE TYPE
TEMPLATE USING
SAMPLE COMMAND OUTPUT
SUMMARY
The template file show_ip_interface for Cisco IOS does not cover all the possible options.
I did resolve this issue by adding, but not sure how you'd want to deal with this in the real code:
STEPS TO REPRODUCE
EXPECTED RESULTS
Parsed object for the output of the command.
ACTUAL RESULTS
The text was updated successfully, but these errors were encountered: