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
tl;dr: Regex for prompt parsing of output searches for > as end of the prompt. This causes an issue with command outputs that include >, which causes trigger to think that this is a break for new output.
Consider the output below: khardson@hostname> show bgp neighbor 1.1.1.1 | match Flags Type: External State: Established Flags: <Sync RSync>
Here is the results that trigger got when running this command: INFO:twisted:Got results: [' Type: External State: Established Flags: <Sync ', '{master}\r\n']
Notice that RSync> is not in the result, and that there are 2 results for one command.
The logs shows that trigger thinks that RSync> is the prompt, causing it to think there is a non-existent second command's output after the RSync>.
Below are the full logs:
INFO:twisted:[hostname] BYTES: '\r\n'
INFO:twisted:[hostname] BYTES: ' Type: External State: Established Flags: <Sync RSync>\r\n'
INFO:twisted:[hostname] STATE: buffer '\rkhardson@hostname> ...\x08\x08\x08\x08\rkhardson@hostmane> ...\x08\x08\x08\x08\rkhardson@hostname> [TRUNCATED]......\x08\x08\x08\x08\r\n Type: External State: Established Flags: <Sync RSync>\r\n'
INFO:twisted:[hostname] STATE: prompt 'RSync>\r'
INFO:twisted:[hostname] STATE: result ' Type: External State: Established Flags: <Sync '
INFO:twisted:[hostname] BYTES: '\r\n'
INFO:twisted:[hostname] BYTES: '{master}\r\nkhardson@hostname> '
INFO:twisted:[hostname] STATE: buffer '\r\n{master}\r\nkhardson@hostname> '
INFO:twisted:[hostname] STATE: prompt 'khardson@hostname> '
INFO:twisted:[hostname] STATE: result '{master}\r\n'
INFO:twisted:[hostname] CHANNEL: out of commands, closing connection...
INFO:twisted:[hostname] Forcefully closing transport connection
INFO:twisted:Got disconnect request, reason: 10, desc: 'user closed connection'
INFO:twisted:Disconnecting with error, code 10
reason: user closed connection
INFO:twisted:[hostname] CHANNEL: out of commands, closing connection...
INFO:twisted:[hostname] Forcefully closing transport connection
INFO:twisted:Got disconnect request, reason: 10, desc: 'user closed connection'
> /home/khardson/tmp/timedog/neteng/timedog/plugins/peer_manager/configure.py(801)parse_template()
INFO:twisted:Disconnecting with error, code 10
reason: user closed connection
INFO:twisted:Forcefully closing transport connection!
(Pdb) INFO:twisted:Got disconnect request, reason: 10, desc: 'user closed connection'
INFO:twisted:Disconnecting with error, code 10
reason: user closed connection
INFO:twisted:connection lost
INFO:twisted:Transport connection lost: Connection was closed cleanly.
INFO:twisted:Client connection lost. Reason: [Failure instance: Traceback (failure with no frames): <class 'twisted.internet.error.ConnectionDone'>: Connection was closed cleanly.
]
INFO:twisted:Got results: [' Type: External State: Established Flags: <Sync ', '{master}\r\n']```
The text was updated successfully, but these errors were encountered:
So what I think needs to be done here is the default IOS regex prompt pattern (see conf/global_settings.py) needs to use a negative look ahead pattern with the hostname as a capture group. This may not be available in all the Python versions Trigger supports.
A work around for now could be to just setup your own custom prompt patterns for IOS devices to ignore that particular string.
tl;dr: Regex for prompt parsing of output searches for
>
as end of the prompt. This causes an issue with command outputs that include>
, which causes trigger to think that this is a break for new output.Consider the output below:
khardson@hostname> show bgp neighbor 1.1.1.1 | match Flags Type: External State: Established Flags: <Sync RSync>
Here is the results that trigger got when running this command:
INFO:twisted:Got results: [' Type: External State: Established Flags: <Sync ', '{master}\r\n']
Notice that
RSync>
is not in the result, and that there are 2 results for one command.The logs shows that trigger thinks that
RSync>
is the prompt, causing it to think there is a non-existent second command's output after theRSync>
.Below are the full logs:
The text was updated successfully, but these errors were encountered: