summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/lib/Server/Plugins/Packages.py8
1 files changed, 7 insertions, 1 deletions
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: