strip garbage after ': end' line

This commit is contained in:
ROTTLER Tamas 2023-03-08 00:58:49 +01:00
parent a22fe6f1e4
commit 83d4c0e6a4

View File

@ -374,6 +374,10 @@ class AsaConfig(ConfigWithShell):
for i in range(0, 5):
if re.search('^\s*: Saved\s*$', shrun[i]):
del shrun[0:i]
# strip garbage after ': end' line
for i in range(-2, -6, -1): # -2! (-1 would delete all if : end is on last line)
if re.search('^\s*: end\s*$', shrun[i]):
del shrun[i+1:]
iproute = []
for cmd in ('sh ip address', 'sh route'):