1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-08-08 22:36:48 +02:00

fix key error if tcp or udp don't exist

This commit is contained in:
Kelly Brazil
2021-04-23 08:30:34 -07:00
parent 4c98fd4b87
commit 20e5c19de4

View File

@@ -121,7 +121,8 @@ def _process(proc_data):
for item in proc_data[protocol + '_ranges']:
port_set.update(range(item['start'], item['end'] + 1))
proc_data['normalized_' + protocol + '_list'] = sorted(set([p for p in proc_data[protocol + '_list'] if p not in port_set]))
if protocol + '_list' in proc_data:
proc_data['normalized_' + protocol + '_list'] = sorted(set([p for p in proc_data[protocol + '_list'] if p not in port_set]))
new_port_ranges = []
state = 'findstart' # 'findstart' or 'findend'