refactor(debug): Dedicated function to generate stringified XML repr
This commit is contained in:
parent
7b6103be72
commit
1bbf75d3dd
@ -477,10 +477,8 @@ def write_new_fwd_direct_xml(
|
|||||||
config_obj: configparser.ConfigParser()) -> bool:
|
config_obj: configparser.ConfigParser()) -> bool:
|
||||||
global arg_fw_rule_data
|
global arg_fw_rule_data
|
||||||
|
|
||||||
fwd_direct_xml_str = lxml.etree.tostring(arg_fw_rule_data,
|
fwd_direct_xml_str = get_xml_str_repr()
|
||||||
pretty_print=True,
|
|
||||||
encoding="UTF-8",
|
|
||||||
xml_declaration=True).decode()
|
|
||||||
try:
|
try:
|
||||||
with open(config_obj.get(configparser.DEFAULTSECT, "firewalld_direct_abs"), "r+") as fwd_file_handle:
|
with open(config_obj.get(configparser.DEFAULTSECT, "firewalld_direct_abs"), "r+") as fwd_file_handle:
|
||||||
log.info(f"Writing new firewalld direct config ...")
|
log.info(f"Writing new firewalld direct config ...")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user