def _verify(self):
try:
self.read(self.path)
except IOError as e:
print "Couldn't open {path}: {reason}".format(path=self.path, reason=e)
exit(-1)
else:
d = {}
for name, attrs in self._configParams.iteritems():
if attrs["required"]:
if not self.has_section(attrs["section"]):
raise LookupError("missing required section {s} in the configuration!\nRUN `isb-cgc-pipelines config` to correct the configuration".format(s=attrs["section"]))
if not self.has_option(attrs["section"], name):
raise LookupError("missing required option {o} in section {s}!\nRun `isb-cgc-pipelines config` to correct the configuration".format(s=attrs["section"], o=name))
try:
d[name] = self.get(attrs["section"], name)
except NoOptionError:
pass
except NoSectionError:
pass
return d
评论列表
文章目录