Use with guard for file reads.

pull/3169/head
Rike-Benjamin Schuppner 12 years ago
parent deaf499ba1
commit 71afb9e432

@ -33,11 +33,11 @@ class InventoryParser(object):
def __init__(self, filename=C.DEFAULT_HOST_LIST):
fh = open(filename)
self.lines = fh.readlines()
self.groups = {}
self.hosts = {}
self._parse()
with open(filename) as fh:
self.lines = fh.readlines()
self.groups = {}
self.hosts = {}
self._parse()
def _parse(self):

Loading…
Cancel
Save