Skip to content

Commit 6d5f4f3

Browse files
committed
fix: rm parsing .xml file with spaces
1 parent 6d91cbd commit 6d5f4f3

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

mamonsu/lib/zbx_template.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,9 @@ def xml(self, type, plugins=[]):
130130
template_data['discovery_rules'] = self._get_all('discovery_rules', plugins)
131131
_xml = minidom.parseString(self.mainTemplate.format(**template_data))
132132
output_xml = ''.join([line.strip() for line in _xml.toxml().splitlines()])
133-
pretty_xml = minidom.parseString(output_xml).toprettyxml(indent=" ", newl="\n")
134133
if Plugin.Type == 'agent':
135-
pretty_xml = ZbxTemplate.turn_agent_type(self, pretty_xml)
136-
return pretty_xml
134+
output_xml = ZbxTemplate.turn_agent_type(self, output_xml)
135+
return output_xml
137136

138137
def _get_all(self, items='items', plugins=[]):
139138
result = ''

0 commit comments

Comments
 (0)