From 3e5ffe0ef35365b95009eeee110717cdd3e72aac Mon Sep 17 00:00:00 2001 From: Narayan Desai Date: Wed, 9 Sep 2009 20:08:28 +0000 Subject: Packages: automatically include placeholder values for version and component fields of sources git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5422 ce84e21b-d406-0410-9b95-82705330c041 --- src/lib/Server/Plugins/Packages.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/lib/Server/Plugins/Packages.py b/src/lib/Server/Plugins/Packages.py index ee15ba61d..14958bbda 100644 --- a/src/lib/Server/Plugins/Packages.py +++ b/src/lib/Server/Plugins/Packages.py @@ -15,7 +15,13 @@ def source_from_xml(xsource): for key, tag in [('groups', 'Group'), ('components', 'Component'), ('arches', 'Arch')]: ret[key] = [item.text for item in xsource.findall(tag)] - ret['version'] = xsource.find('Version').text + # version and component need to both contain data for sources to work + try: + ret['version'] = xsource.find('Version').text + except: + ret['version'] = 'placeholder' + if ret['component'] == []: + ret['component'] = ['placeholder'] if xsource.find('RawURL') is not None: ret['rawurl'] = xsource.find('RawURL').text else: -- cgit v1.2.3-1-g7c22