Verified Commit 54f35b4a authored by Martin Petráček's avatar Martin Petráček
Browse files

make all scripts python3 compatible

parent 0446dcb6
#!/usr/bin/env python2
#!/usr/bin/env python3
import fileinput
import os, os.path
......
#!/usr/bin/env python2
#!/usr/bin/env python3
import os
import sys
......
#!/usr/bin/env python2
#!/usr/bin/env python3
import os
import sys
......
#!/usr/bin/env python2
#!/usr/bin/env python3
import fileinput
import json
......@@ -130,17 +130,17 @@ logging.debug("Listening...")
while True:
try:
logging.debug('Getting data...')
line = conntrack.stdout.readline()
line = conntrack.stdout.readline().decode()
if not line:
break
line = string.strip(line)
line = line.strip()
logging.debug(line)
if not line:
continue
skip = False
try:
data = json.loads(line)
except:
except ValueError:
logging.warn("Error decoding json")
continue
if 'ether' not in data.keys() or 'src' not in data['ether'].keys():
data['ether']={}
......
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