Use with guard for file reads.

This commit is contained in:
Rike-Benjamin Schuppner 2013-06-10 15:52:04 +02:00
commit 71afb9e432

View file

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