Update trigger_project to use convert_mapping_to_xml()
Change-Id: I4579a7609468fe8e789e59d4507bde2681bc0524
This commit is contained in:
parent
f05f2be5f2
commit
b9603c1eea
@ -540,11 +540,11 @@ def trigger_project(tconfigs, project_def, param_order=None):
|
|||||||
elif param_type == 'property-file':
|
elif param_type == 'property-file':
|
||||||
params = XML.SubElement(tconfigs,
|
params = XML.SubElement(tconfigs,
|
||||||
pt_prefix + 'FileBuildParameters')
|
pt_prefix + 'FileBuildParameters')
|
||||||
properties = XML.SubElement(params, 'propertiesFile')
|
property_file_mapping = [
|
||||||
properties.text = project_def['property-file']
|
('property-file', 'propertiesFile', None),
|
||||||
failOnMissing = XML.SubElement(params, 'failTriggerOnMissing')
|
('fail-on-missing', 'failTriggerOnMissing', False)]
|
||||||
failOnMissing.text = str(project_def.get('fail-on-missing',
|
convert_mapping_to_xml(params, project_def,
|
||||||
False)).lower()
|
property_file_mapping, fail_required=True)
|
||||||
if 'file-encoding' in project_def:
|
if 'file-encoding' in project_def:
|
||||||
XML.SubElement(params, 'encoding'
|
XML.SubElement(params, 'encoding'
|
||||||
).text = project_def['file-encoding']
|
).text = project_def['file-encoding']
|
||||||
@ -552,13 +552,13 @@ def trigger_project(tconfigs, project_def, param_order=None):
|
|||||||
# TODO: These parameters only affect execution in
|
# TODO: These parameters only affect execution in
|
||||||
# publishers of matrix projects; we should warn if they are
|
# publishers of matrix projects; we should warn if they are
|
||||||
# used in other contexts.
|
# used in other contexts.
|
||||||
XML.SubElement(params, "useMatrixChild").text = (
|
use_matrix_child_files_mapping = [
|
||||||
str(project_def['use-matrix-child-files']).lower())
|
('use-matrix-child-files', "useMatrixChild", None),
|
||||||
XML.SubElement(params, "combinationFilter").text = (
|
('matrix-child-combination-filter',
|
||||||
project_def.get('matrix-child-combination-filter', ''))
|
"combinationFilter", ''),
|
||||||
XML.SubElement(params, "onlyExactRuns").text = (
|
('only-exact-matrix-child-runs', "onlyExactRuns", False)]
|
||||||
str(project_def.get('only-exact-matrix-child-runs',
|
convert_mapping_to_xml(params, project_def,
|
||||||
False)).lower())
|
use_matrix_child_files_mapping, fail_required=True)
|
||||||
elif param_type == 'current-parameters' and param_value:
|
elif param_type == 'current-parameters' and param_value:
|
||||||
XML.SubElement(tconfigs, pt_prefix + 'CurrentBuildParameters')
|
XML.SubElement(tconfigs, pt_prefix + 'CurrentBuildParameters')
|
||||||
elif param_type == 'node-parameters' and param_value:
|
elif param_type == 'node-parameters' and param_value:
|
||||||
@ -595,9 +595,11 @@ def trigger_project(tconfigs, project_def, param_order=None):
|
|||||||
params_list = param_value
|
params_list = param_value
|
||||||
for name, value in params_list.items():
|
for name, value in params_list.items():
|
||||||
param_tag = XML.SubElement(config_tag, param_tag_text)
|
param_tag = XML.SubElement(config_tag, param_tag_text)
|
||||||
XML.SubElement(param_tag, 'name').text = name
|
mapping = [
|
||||||
XML.SubElement(param_tag, 'value').text = str(
|
('', 'name', name),
|
||||||
value or False).lower()
|
('', 'value', value or False)]
|
||||||
|
convert_mapping_to_xml(param_tag, project_def,
|
||||||
|
mapping, fail_required=True)
|
||||||
|
|
||||||
|
|
||||||
def convert_mapping_to_xml(parent, data, mapping, fail_required=False):
|
def convert_mapping_to_xml(parent, data, mapping, fail_required=False):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user