strip junk before asa config

This commit is contained in:
ROTTLER Tamas 2023-03-03 02:14:01 +01:00
parent abd2936da7
commit 4936a2088f

View File

@ -369,6 +369,11 @@ class AsaConfig(ConfigWithShell):
self._shell_command(channel, 'term pager 0', waitfor='#\s*$', waitmax=1) self._shell_command(channel, 'term pager 0', waitfor='#\s*$', waitmax=1)
shrun = self._shell_command(channel, 'sh run', waitfor=': end') shrun = self._shell_command(channel, 'sh run', waitfor=': end')
# strip late previous lines and command echo
for i in range(0, 5):
if re.search('^\s*: Saved\s*$', shrun[i]):
del shrun[0:i]
iproute = [] iproute = []
for cmd in ('sh ip address', 'sh route'): for cmd in ('sh ip address', 'sh route'):
iproute.append('# '+ cmd.center(76, '=')) iproute.append('# '+ cmd.center(76, '='))