From 1bbf75d3ddeca1c6313005d161331238ce20f0b8 Mon Sep 17 00:00:00 2001 From: hygienic-books Date: Tue, 5 Jul 2022 17:26:10 +0200 Subject: [PATCH] refactor(debug): Dedicated function to generate stringified XML repr --- update-firewall-source.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/update-firewall-source.py b/update-firewall-source.py index dc89c60..0be4fbe 100644 --- a/update-firewall-source.py +++ b/update-firewall-source.py @@ -477,10 +477,8 @@ def write_new_fwd_direct_xml( config_obj: configparser.ConfigParser()) -> bool: global arg_fw_rule_data - fwd_direct_xml_str = lxml.etree.tostring(arg_fw_rule_data, - pretty_print=True, - encoding="UTF-8", - xml_declaration=True).decode() + fwd_direct_xml_str = get_xml_str_repr() + try: with open(config_obj.get(configparser.DEFAULTSECT, "firewalld_direct_abs"), "r+") as fwd_file_handle: log.info(f"Writing new firewalld direct config ...")