diff options
author | Narayan Desai <desai@mcs.anl.gov> | 2004-09-07 17:54:04 +0000 |
---|---|---|
committer | Narayan Desai <desai@mcs.anl.gov> | 2004-09-07 17:54:04 +0000 |
commit | a5b5c2ff029cdff6af0d0446dda7e1f50ef83b71 (patch) | |
tree | c9802391a74f981ea1d3af260c951ab73f15db46 /tools | |
parent | 638bce408642e56804b1d63e786e5eff6b7ef0fa (diff) | |
download | bcfg2-a5b5c2ff029cdff6af0d0446dda7e1f50ef83b71.tar.gz bcfg2-a5b5c2ff029cdff6af0d0446dda7e1f50ef83b71.tar.bz2 bcfg2-a5b5c2ff029cdff6af0d0446dda7e1f50ef83b71.zip |
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
Diffstat (limited to 'tools')
-rw-r--r-- | tools/bundlecvt.py | 9 |
1 files changed, 6 insertions, 3 deletions
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) |