Use with guard for file reads.

parent deaf499b
......@@ -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 = {}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment