Commit 553cd2ea authored by Tomas Hlavacek's avatar Tomas Hlavacek
Browse files

Fix BIRD show protocols partitioning

Fix BirdShowProtocolsCommand and parseBirdShowProtocols not to duplicate
partitioning of the result (for the display as a table). Before this patch
it didn't worked because parseBirdShowProtocols reduced results to i.e.
[100..200] and later decorateResult in BirdShowProtocols reduced the
previously reduced result of length 100 to [100..200] which is empty.
parent db343b70
......@@ -106,7 +106,7 @@ def bird_reduce_paths(paths):
return sorted(paths,key=assign_value)
def parseBirdShowProtocols(text,resrange=None):
def parseBirdShowProtocols(text):
def parseShowProtocolsLine(line):
m = bird_show_proto_line_regexp.match(line)
if(m):
......@@ -138,10 +138,7 @@ def parseBirdShowProtocols(text,resrange=None):
# else:
# ulgmodel.log("ulgbird.parseBirdShowProtocols skipping unparsable line: "+l)
if(resrange):
return (header,table[resrange:resrange+defaults.range_step],len(table))
else:
return (header,table,len(table))
return (header,table,len(table))
# classes
......@@ -200,7 +197,7 @@ class BirdShowProtocolsCommand(ulgmodel.TextCommand):
if((not session.getRouter()) or (not decorator_helper)):
return "<pre>\n%s\n</pre>" % session.getResult()
else:
pr = parseBirdShowProtocols(session.getResult(),session.getRange())
pr = parseBirdShowProtocols(session.getResult())
table_header = pr[0]
table = []
......
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