Merge "Use convert_mapping_to_xml helper function"

This commit is contained in:
Zuul 2018-06-11 01:35:40 +00:00 committed by Gerrit Code Review
commit a3da86e5ae
1 changed files with 7 additions and 2 deletions

View File

@ -36,6 +36,7 @@ Job template example:
import xml.etree.ElementTree as XML
import jenkins_jobs.modules.base
from jenkins_jobs.modules.helpers import convert_mapping_to_xml
class Folder(jenkins_jobs.modules.base.Base):
@ -50,7 +51,11 @@ class Folder(jenkins_jobs.modules.base.Base):
XML.SubElement(xml_parent, 'views')
attributes = {"class": "hudson.views.DefaultViewsTabBar"}
XML.SubElement(xml_parent, 'viewsTabBar', attrib=attributes)
XML.SubElement(xml_parent, 'primaryView').text = 'All'
XML.SubElement(xml_parent, 'healthMetrics')
mappings = [
('', 'primaryView', 'All'),
('', 'healthMetrics', ''),
]
convert_mapping_to_xml(xml_parent, data, mappings, True)
return xml_parent