Browse Source

trig-param-build: Utilize convert_mapping_to_xml

Change-Id: I1f7130bda46f268a9f25de152a0c767f82cbfa1d
Signed-off-by: Tan Heng Yeow <E0032242@u.nus.edu>
tags/2.5.0
tanhengyeow 10 months ago
parent
commit
e14e748c5a
1 changed files with 6 additions and 8 deletions
  1. 6
    8
      jenkins_jobs/modules/publishers.py

+ 6
- 8
jenkins_jobs/modules/publishers.py View File

@@ -563,14 +563,12 @@ def trigger_parameterized_builds(registry, xml_parent, data):
563 563
 
564 564
         condition = XML.SubElement(tconfig, 'condition')
565 565
         condition.text = project_def.get('condition', 'ALWAYS')
566
-        trigger_from_child_projects = XML.SubElement(
567
-            tconfig, 'triggerFromChildProjects')
568
-        trigger_from_child_projects.text = str(
569
-            project_def.get('trigger-from-child-projects', False)).lower()
570
-        trigger_with_no_params = XML.SubElement(tconfig,
571
-                                                'triggerWithNoParameters')
572
-        trigger_with_no_params.text = str(
573
-            project_def.get('trigger-with-no-params', False)).lower()
566
+        mapping = [
567
+            ('trigger-from-child-projects', 'triggerFromChildProjects', False),
568
+            ('trigger-with-no-params', 'triggerWithNoParameters', False),
569
+        ]
570
+        helpers.convert_mapping_to_xml(
571
+            tconfig, project_def, mapping, fail_required=False)
574 572
 
575 573
 
576 574
 def trigger(registry, xml_parent, data):

Loading…
Cancel
Save