Skip to content

Commit

Permalink
Update bind collector
Browse files Browse the repository at this point in the history
  • Loading branch information
maximshe committed Jun 15, 2022
1 parent bf66548 commit f0361e6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/collectors/bind/bind.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,16 @@ def collect(self):
self.log.error('Couldnt connect to bind: %s', e)
return {}

tree = ElementTree.parse(req)
tree = ElementTree.fromstring(req.read())

if not tree:
raise ValueError("Corrupt XML file, no statistics found")

root = tree.find('bind/statistics')
root = tree

if 'resolver' in self.config['publish']:
for view in root.findall('views/view'):
name = view.find('name').text
name = view.get('name')
if name == '_bind' and not self.config['publish_view_bind']:
continue
if name == '_meta' and not self.config['publish_view_meta']:
Expand Down

0 comments on commit f0361e6

Please sign in to comment.