Skip to content

Commit

Permalink
Added support for parsing of "long pairs" sent by Cisco ASR devices.
Browse files Browse the repository at this point in the history
  • Loading branch information
jathanism committed Mar 1, 2016
1 parent 2e64e37 commit 0e408c8
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ Changelog

The change history, in order from newest to oldest.

1.13
====
+ Added support for parsing of "long pairs" sent by Cisco ASR devices.

1.12
====

Expand Down
4 changes: 4 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ do_auth.py
Versions
========

1.13
----
+ Added support for parsing of "long pairs" sent by Cisco ASR devices.

1.12
----

Expand Down
25 changes: 18 additions & 7 deletions do_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@
__email__ = '[email protected]'
__copyright__ = 'Dan Schmidt'
__license__ = 'GPL-3.0'
__version__ = '1.12'
__version__ = '1.13'

try:
import configparser
Expand Down Expand Up @@ -583,13 +583,24 @@ def main():
i = 2
our_command = av_pairs[i].split("=")

while not (our_command[1] == "<cr>\n"):
the_command = the_command + " " + our_command[1].strip('\n')
i = i + 1
if i == len(av_pairs): # Firewalls don't give a <cr>!!
break
if len(our_command[1]) > 1:
while not (our_command[1] == "<cr>\n"):
the_command = the_command + " " + our_command[1].strip('\n')
i = i + 1
if i == len(av_pairs): # Firewalls don't give a <cr>!!
break

our_command = av_pairs[i].split("=")
our_command = av_pairs[i].split("=")
while our_command[0] == '\n':
i = i +1
if i == len(av_pairs):
our_command = ['break_loop', "<cr>\n"]
break

our_command = av_pairs[i].split("=")

if len(our_command) == 1:
our_command = ['cmd-arg'] + our_command

# DEBUG - We got the command
log.debug('Got command: %r' % the_command)
Expand Down

0 comments on commit 0e408c8

Please sign in to comment.