Use context manager to read conf file.

This commit is contained in:
Brad Warren 2017-08-10 16:36:08 -07:00
parent 290f5b8ce7
commit 8c4ff5cb63

View file

@ -70,7 +70,8 @@ class Installer(plugins_common.Plugin):
self._set_config_dir()
self.fn = self.find_postfix_cf()
self.raw_cf = open(self.fn).readlines()
with open(self.fn) as f:
self.raw_cf = f.readlines()
self.cf = map(string.strip, self.raw_cf)
#self.cf = [line for line in cf if line and not line.startswith("#")]
# XXX ensure we raise the right kinds of exceptions