Commit db98f339 authored by Tomas Hlavacek's avatar Tomas Hlavacek

Fix remote BIRD prompt line removal

Prompt - like "bird>" is removed from each and every line parsed. And
only first two lines are unconditialnally droped. Although this is not
the final solution (like rewriting (p)expect or choosing different one)
this should work for me at least for now.
parent 759cc1db
...@@ -606,13 +606,13 @@ class BirdRouterRemote(ulgmodel.RemoteRouter,BirdRouter): ...@@ -606,13 +606,13 @@ class BirdRouterRemote(ulgmodel.RemoteRouter,BirdRouter):
def stripFirstLines(string): def stripFirstLines(string):
lines = str.splitlines(string) lines = str.splitlines(string)
r = re.sub(BIRD_CONSOLE_PROMPT_REGEXP,'',lines[2]) + '\n' r = ''
for l in lines[3:]: for l in lines[2:]:
r = r + l + '\n' r = r + re.sub(BIRD_CONSOLE_PROMPT_REGEXP,'',l) + '\n'
return r return r
out = s.before out = s.before
# ulgmodel.debug("BIRD OUT: "+out) ulgmodel.debug("BIRD OUT: "+out)
outfile.write(stripFirstLines(out)) outfile.write(stripFirstLines(out))
def rescanPeers(self): def rescanPeers(self):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment