Browse Source

Merge "Use convert_mapping_to_xml helper function"

Zuul 10 months ago
parent
commit
a3da86e5ae
1 changed files with 7 additions and 2 deletions
  1. 7
    2
      jenkins_jobs/modules/project_folder.py

+ 7
- 2
jenkins_jobs/modules/project_folder.py View File

@@ -36,6 +36,7 @@ Job template example:
36 36
 
37 37
 import xml.etree.ElementTree as XML
38 38
 import jenkins_jobs.modules.base
39
+from jenkins_jobs.modules.helpers import convert_mapping_to_xml
39 40
 
40 41
 
41 42
 class Folder(jenkins_jobs.modules.base.Base):
@@ -50,7 +51,11 @@ class Folder(jenkins_jobs.modules.base.Base):
50 51
         XML.SubElement(xml_parent, 'views')
51 52
         attributes = {"class": "hudson.views.DefaultViewsTabBar"}
52 53
         XML.SubElement(xml_parent, 'viewsTabBar', attrib=attributes)
53
-        XML.SubElement(xml_parent, 'primaryView').text = 'All'
54
-        XML.SubElement(xml_parent, 'healthMetrics')
54
+
55
+        mappings = [
56
+            ('', 'primaryView', 'All'),
57
+            ('', 'healthMetrics', ''),
58
+        ]
59
+        convert_mapping_to_xml(xml_parent, data, mappings, True)
55 60
 
56 61
         return xml_parent

Loading…
Cancel
Save