aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Sokolovsky <paul.sokolovsky@linaro.org>2016-01-13 20:19:29 +0200
committerPaul Sokolovsky <paul.sokolovsky@linaro.org>2016-01-13 20:19:29 +0200
commita81fa880270a971f4fa4ba32a82afbb41263dc59 (patch)
tree3930f76d276dfcc12ac92b0c972cdd8905633271
parentbe21d6985c2078a96deae308250ff13acd5fc882 (diff)
iploc.py: Report and properly skip unmatched lines.
Change-Id: I5f637362d5ec36670366834c53f9c114eba2f12a
-rw-r--r--iploc.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/iploc.py b/iploc.py
index 56c4b92..e68b738 100644
--- a/iploc.py
+++ b/iploc.py
@@ -94,7 +94,10 @@ def main(file_names):
for line in fi:
locations = []
match = re.search('\d+\.\d+\.\d+\.\d+\s[^ ]+\s[^ ]+', line)
- if match:
+ if not match:
+ log.warn("Unmatched %s:%s: '%s':", fi.filename(), fi.filelineno(), line)
+ continue
+ else:
try:
raw_data = match.group()
data = raw_data.split()