From a5b5c2ff029cdff6af0d0446dda7e1f50ef83b71 Mon Sep 17 00:00:00 2001 From: Narayan Desai Date: Tue, 7 Sep 2004 17:54:04 +0000 Subject: fix error handling (Logical change 1.58) git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@317 ce84e21b-d406-0410-9b95-82705330c041 --- tools/bundlecvt.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'tools') diff --git a/tools/bundlecvt.py b/tools/bundlecvt.py index cae4e2d23..176c9a46d 100644 --- a/tools/bundlecvt.py +++ b/tools/bundlecvt.py @@ -6,7 +6,7 @@ from sys import argv from elementtree.ElementTree import XML, Element, tostring if __name__ == '__main__': - bundles = argv[1] + bname = argv[1] translations = argv[2] tdata = {} @@ -17,14 +17,17 @@ if __name__ == '__main__': if entry.tag == 'Image': continue tdata[data.attrib['system']][entry.tag][entry.attrib['name']] = entry.getchildren() - bundle = XML(open('/home/desai/data/bold/b/ssh.xml').read()) + bundle = XML(open(bname).read()) new = Element('Bundle', version='2.0', name=bundle.attrib['name']) for system in tdata.keys(): b = Element("System", name=system) for entry in bundle.getchildren(): - map(b.append, tdata[system][entry.tag][entry.attrib['name']]) + try: + map(b.append, tdata[system][entry.tag][entry.attrib['name']]) + except: + pass new.append(b) print tostring(new) -- cgit v1.2.3-1-g7c22