mirror of
https://github.com/kellyjonbrazil/jc.git
synced 2025-06-19 00:17:51 +02:00
always make to/from_service None if ports are assigned
This commit is contained in:
@ -380,13 +380,15 @@ def _parse_to_from(linedata, direction, rule_obj=None):
|
|||||||
|
|
||||||
# find the numeric port(s)
|
# find the numeric port(s)
|
||||||
linedata_list = linedata.split(':', maxsplit=1)
|
linedata_list = linedata.split(':', maxsplit=1)
|
||||||
if len(linedata_list) == 2 and linedata_list[1].strip().isnumeric():
|
if len(linedata_list) == 2 and linedata_list[0].strip().isnumeric():
|
||||||
rule_obj[direction + '_start_port'] = linedata_list[0].strip()
|
rule_obj[direction + '_start_port'] = linedata_list[0].strip()
|
||||||
rule_obj[direction + '_end_port'] = linedata_list[1].strip()
|
rule_obj[direction + '_end_port'] = linedata_list[1].strip()
|
||||||
|
rule_obj[direction + '_service'] = None
|
||||||
linedata = ''
|
linedata = ''
|
||||||
elif len(linedata_list) == 1 and linedata_list[0].strip().isnumeric():
|
elif len(linedata_list) == 1 and linedata_list[0].strip().isnumeric():
|
||||||
rule_obj[direction + '_start_port'] = linedata_list[0].strip()
|
rule_obj[direction + '_start_port'] = linedata_list[0].strip()
|
||||||
rule_obj[direction + '_end_port'] = linedata_list[0].strip()
|
rule_obj[direction + '_end_port'] = linedata_list[0].strip()
|
||||||
|
rule_obj[direction + '_service'] = None
|
||||||
linedata = ''
|
linedata = ''
|
||||||
|
|
||||||
# only thing left should be the service name.
|
# only thing left should be the service name.
|
||||||
|
Reference in New Issue
Block a user