From 4eea72ddf594fd3cacb4de58b93177c268df2e18 Mon Sep 17 00:00:00 2001 From: karaim Date: Tue, 6 Sep 2016 19:09:30 +0200 Subject: [PATCH] Regex for Metric Script don't work well with Nexus output where we don't have "Metrics", but "Metric" after TOS type. regex doesnt match and as a result diagram is generated without connections. Setting "s" character in regex as optional will make the script also working with Nexus output. --- ospfcli2dot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ospfcli2dot b/ospfcli2dot index f6752ca..272df1d 100644 --- a/ospfcli2dot +++ b/ospfcli2dot @@ -177,7 +177,7 @@ with open(filename, 'r') as infile: if(m): transit = m.group(1) continue - m = re.search('TOS 0 Metrics: (\d*)', line) + m = re.search('\s+TOS\s+\d\s+Metric(s)?:\s+(\d*)', line) if(m): if(neighbour is not None): rtr.addlink(neighbour, interfaceip, m.group(1))