diff options
author | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2012-09-11 10:35:41 -0400 |
---|---|---|
committer | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2012-09-11 10:35:41 -0400 |
commit | 86a7e70a49332af81434e6f7ede4d4e3d8b6731a (patch) | |
tree | f7a4230343cbc14b41ed92df7201597b421d8c92 | |
parent | 71c679e1a0105490bd5845a15de5e8f1a32e2166 (diff) | |
download | bcfg2-86a7e70a49332af81434e6f7ede4d4e3d8b6731a.tar.gz bcfg2-86a7e70a49332af81434e6f7ede4d4e3d8b6731a.tar.bz2 bcfg2-86a7e70a49332af81434e6f7ede4d4e3d8b6731a.zip |
bcfg2-info: fixed bug when building an entry for buildfile raised IOError
-rwxr-xr-x | src/sbin/bcfg2-info | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/sbin/bcfg2-info b/src/sbin/bcfg2-info index f188131f0..9ee02fd71 100755 --- a/src/sbin/bcfg2-info +++ b/src/sbin/bcfg2-info @@ -388,6 +388,11 @@ class infoCore(cmd.Cmd, Bcfg2.Server.Core.BaseCore): self.Bind(entry, metadata) data = lxml.etree.tostring(entry, xml_declaration=False).decode('UTF-8') + except Exception: + print("Failed to build entry %s for host %s: %s" % + (fname, client, traceback.format_exc().splitlines()[-1])) + raise + try: if outfile: open(outfile, 'w').write(data) else: @@ -396,10 +401,6 @@ class infoCore(cmd.Cmd, Bcfg2.Server.Core.BaseCore): err = sys.exc_info()[1] print("Could not write to %s: %s" % (outfile, err)) print(data) - except Exception: - print("Failed to build entry %s for host %s: %s" % - (fname, client, traceback.format_exc().splitlines()[-1])) - raise def do_buildbundle(self, args): """Render a bundle for client.""" |