mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-20 03:16:12 +00:00
netflow, migrate flowd aggregator to python 3
This commit is contained in:
parent
0b40897fd3
commit
31982e2872
@ -1,4 +1,4 @@
|
||||
#!/usr/local/bin/python2.7
|
||||
#!/usr/local/bin/python3
|
||||
"""
|
||||
Copyright (c) 2016-2018 Ad Schellevis <ad@opnsense.org>
|
||||
All rights reserved.
|
||||
@ -160,7 +160,8 @@ class Main(object):
|
||||
syslog.syslog(syslog.LOG_NOTICE, 'vacuum done')
|
||||
except:
|
||||
syslog.syslog(syslog.LOG_ERR, 'flowd aggregate died with message %s' % (traceback.format_exc()))
|
||||
return
|
||||
raise
|
||||
|
||||
# rotate if needed
|
||||
check_rotate(self.config.flowd_source)
|
||||
|
||||
@ -213,7 +214,7 @@ if __name__ == '__main__':
|
||||
sortby = 'cumulative'
|
||||
ps = pstats.Stats(pr, stream=s).sort_stats(sortby)
|
||||
ps.print_stats()
|
||||
print s.getvalue()
|
||||
print (s.getvalue())
|
||||
else:
|
||||
Main()
|
||||
elif cmd_args.repair:
|
||||
|
||||
@ -44,7 +44,7 @@ class Interfaces(object):
|
||||
subprocess.call(['/sbin/ifconfig', '-l'], stdout=output_stream, stderr=open(os.devnull, 'wb'))
|
||||
output_stream.seek(0)
|
||||
if_index = 1
|
||||
for line in output_stream.read().split('\n')[0].split():
|
||||
for line in output_stream.readline().split():
|
||||
self._if_index["%s" % if_index] = line
|
||||
if_index += 1
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user