refactor(xml): Shorten section name var
This commit is contained in:
parent
1bbf75d3dd
commit
c4781aa615
@ -285,7 +285,7 @@ def add_rule_elem(
|
||||
prio: int,
|
||||
target: str,
|
||||
/, *,
|
||||
arg_section_name: str = None,
|
||||
arg_section: str = None,
|
||||
arg_proto: str = None,
|
||||
arg_state: str = None,
|
||||
arg_ports: list = None,
|
||||
@ -307,8 +307,7 @@ def add_rule_elem(
|
||||
f"""{"--match multiport --destination-ports " + ",".join(arg_ports) + " " if arg_ports else ""}""" \
|
||||
f"""{"--source " + arg_address + " " if arg_address else ""}""" \
|
||||
f"""--jump {target}""" \
|
||||
f"""
|
||||
{" --match comment --comment " + chr(34) + arg_section_name[:256] + chr(34) if arg_section_name else ""}"""
|
||||
f"""{" --match comment --comment " + chr(34) + arg_section[:256] + chr(34) if arg_section else ""}"""
|
||||
except lxml.etree.LxmlError as le:
|
||||
log.error(f"""Failed to add XML '<rule ipv=f"{address_family}" .../>'\n"""
|
||||
f"Verbatim exception was:\n"
|
||||
@ -382,7 +381,7 @@ def add_fw_rule_to_xml(
|
||||
address_family,
|
||||
rules_already_added[address_family],
|
||||
target,
|
||||
arg_section_name=section_name,
|
||||
arg_section=section_name,
|
||||
arg_proto=proto,
|
||||
arg_state=config_obj.get(section_name, "state"),
|
||||
arg_ports=ports,
|
||||
@ -398,7 +397,7 @@ def add_fw_rule_to_xml(
|
||||
address_family,
|
||||
rules_already_added[address_family],
|
||||
target,
|
||||
arg_section_name=section_name,
|
||||
arg_section=section_name,
|
||||
arg_proto=proto,
|
||||
arg_state=config_obj.get(section_name, "state"),
|
||||
arg_ports=ports)
|
||||
|
Loading…
x
Reference in New Issue
Block a user