summaryrefslogtreecommitdiffstats
path: root/src/sbin/bcfg2-admin
diff options
context:
space:
mode:
Diffstat (limited to 'src/sbin/bcfg2-admin')
-rwxr-xr-xsrc/sbin/bcfg2-admin14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/sbin/bcfg2-admin b/src/sbin/bcfg2-admin
index 2a570df56..52525e072 100755
--- a/src/sbin/bcfg2-admin
+++ b/src/sbin/bcfg2-admin
@@ -236,8 +236,18 @@ def do_compare(cargs):
print "Usage: bcfg2-admin compare <old> <new>"
raise SystemExit
- new = lxml.etree.parse(new).getroot()
- old = lxml.etree.parse(old).getroot()
+ try:
+ new = lxml.etree.parse(new).getroot()
+ except IOError:
+ print "Failed to read %s" % (new)
+ raise SystemExit, 1
+
+ try:
+ old = lxml.etree.parse(old).getroot()
+ except IOError:
+ print "Failed to read %s" % (old)
+ raise SystemExit, 1
+
for src in [new, old]:
for bundle in src.findall('./Bundle'):
if bundle.get('name')[-4:] == '.xml':