Merge "Update matrix_combinations_param to use convert_xml()"

This commit is contained in:
Jenkins 2017-07-10 05:16:10 +00:00 committed by Gerrit Code Review
commit ed90a0cf0c
1 changed files with 6 additions and 9 deletions

View File

@ -713,15 +713,12 @@ def matrix_combinations_param(registry, xml_parent, data):
element_name = 'hudson.plugins.matrix__configuration__parameter.' \
'MatrixCombinationsParameterDefinition'
pdef = XML.SubElement(xml_parent, element_name)
if 'name' not in data:
raise JenkinsJobsException('matrix-combinations must have a name '
'parameter.')
XML.SubElement(pdef, 'name').text = data['name']
XML.SubElement(pdef, 'description').text = data.get('description', '')
combination_filter = data.get('filter')
if combination_filter:
XML.SubElement(pdef, 'defaultCombinationFilter').text = \
combination_filter
mapping = [
('name', 'name', None),
('description', 'description', ''),
('filter', 'defaultCombinationFilter', '')]
convert_mapping_to_xml(pdef, data, mapping, fail_required=True)
return pdef