1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-06-25 00:37:31 +02:00

fix int conversions if 'rules' key does not exist

This commit is contained in:
Kelly Brazil
2021-04-21 09:09:09 -07:00
parent 23635def8b
commit 90076090f0

View File

@ -40,7 +40,7 @@ Schema:
"from_transport": string, # null if from_service is set "from_transport": string, # null if from_service is set
"from_start_port": integer, # null if from_service is set "from_start_port": integer, # null if from_service is set
"from_end_port": integer, # null if from_service is set "from_end_port": integer, # null if from_service is set
"from_service": string, # null if any above are set "from_service": string # null if any above are set
} }
] ]
} }
@ -304,6 +304,8 @@ def _process(proc_data):
""" """
int_list = ['index', 'to_subnet', 'to_start_port', 'to_end_port', 'from_subnet', int_list = ['index', 'to_subnet', 'to_start_port', 'to_end_port', 'from_subnet',
'from_start_port', 'from_end_port'] 'from_start_port', 'from_end_port']
if 'rules' in proc_data:
for i, item in enumerate(proc_data['rules']): for i, item in enumerate(proc_data['rules']):
for key in item: for key in item:
if key in int_list: if key in int_list: