Merge "Raise if parsing, rendering, or writing fails"
This commit is contained in:
commit
039a8c050e
@ -67,7 +67,7 @@ def main():
|
||||
environment = jinja2.Environment(loader=loader)
|
||||
except Exception as e:
|
||||
logger.error("initialising template environment failed: %s" % e)
|
||||
return 1
|
||||
raise
|
||||
|
||||
try:
|
||||
service_types = os_service_types.ServiceTypes(
|
||||
@ -88,7 +88,7 @@ def main():
|
||||
except Exception as e:
|
||||
logger.error("parsing template %s failed: %s" %
|
||||
(templateFile, e))
|
||||
continue
|
||||
raise
|
||||
|
||||
|
||||
try:
|
||||
@ -101,7 +101,7 @@ def main():
|
||||
except Exception as e:
|
||||
logger.error("rendering template %s failed: %s" %
|
||||
(templateFile, e))
|
||||
continue
|
||||
raise
|
||||
|
||||
try:
|
||||
target_directory = os.path.join(args.output_directory,
|
||||
@ -116,7 +116,7 @@ def main():
|
||||
fh.write(output.encode('utf8'))
|
||||
except (IOError, OSError, UnicodeEncodeError) as e:
|
||||
logger.error("writing %s failed: %s" % (target_file, e))
|
||||
continue
|
||||
raise
|
||||
|
||||
return 0
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user