summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2011-01-22 10:48:02 -0600
committerNarayan Desai <desai@mcs.anl.gov>2011-01-22 10:48:02 -0600
commitfc2da27548c0b318f45d386dbcce38d8a2e817b5 (patch)
tree631097ac708aed3552440106e5e8f1f316246741
parente08b9bdaa13375321ed827d3bf75cd54a05b19fe (diff)
downloadbcfg2-fc2da27548c0b318f45d386dbcce38d8a2e817b5.tar.gz
bcfg2-fc2da27548c0b318f45d386dbcce38d8a2e817b5.tar.bz2
bcfg2-fc2da27548c0b318f45d386dbcce38d8a2e817b5.zip
bcfg2-info: print error message when buildfile fails (Resolves Ticket #804)
-rwxr-xr-xsrc/sbin/bcfg2-info11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/sbin/bcfg2-info b/src/sbin/bcfg2-info
index 47fdf82d3..c1ee65d50 100755
--- a/src/sbin/bcfg2-info
+++ b/src/sbin/bcfg2-info
@@ -278,10 +278,13 @@ class infoCore(cmd.Cmd, Bcfg2.Server.Core.Core):
if len(args.split()) == 2:
fname, client = args.split()
entry = lxml.etree.Element('Path', type='file', name=fname)
- metadata = self.build_metadata(client)
- self.Bind(entry, metadata)
- print(lxml.etree.tostring(entry, encoding="UTF-8",
- xml_declaration=True))
+ try:
+ metadata = self.build_metadata(client)
+ self.Bind(entry, metadata)
+ print(lxml.etree.tostring(entry, encoding="UTF-8",
+ xml_declaration=True))
+ except:
+ print("Failed to build entry %s for host %s" % (fname, client))
else:
print('Usage: buildfile filename hostname')