Skip to content

Commit

Permalink
print fields without asn, to save space
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Pels committed Jul 18, 2024
1 parent d44c61c commit 934f7ae
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions commparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,9 +262,6 @@ def _print_match(self, community, candidate, fieldvals):
"""
output_sections = []
output_fields = []
for attr in ("globaladmin", "asn", "asn4"):
if attr in candidate:
asn = candidate[attr]
if "localadmin" in candidate:
for fid, field in enumerate(candidate["localadmin"]["fields"]):
if "description" in field:
Expand All @@ -291,4 +288,4 @@ def _print_match(self, community, candidate, fieldvals):
output_fields.append(f'{field["name"]}={fieldvals[offset + fid]}')
output_sections.append(",".join(output_fields))

return f"{asn}:{':'.join(output_sections)}"
return f"{':'.join(output_sections)}"

0 comments on commit 934f7ae

Please sign in to comment.