diff options
author | Veluri Mithun <velurimithun38@gmail.com> | 2018-05-30 11:15:59 +0530 |
---|---|---|
committer | Veluri Mithun <velurimithun38@gmail.com> | 2018-06-09 18:00:54 +0530 |
commit | 71523ec35c7e39d93c115327ed90d44942e596a0 (patch) | |
tree | bf8aa3230810d3c0dc5244a50717b8661f78afd2 /jenkins_jobs/modules/project_folder.py | |
parent | 307c09cff3ef030a72859cdc63ce555810af486d (diff) | |
download | python-jenkins-job-builder-71523ec35c7e39d93c115327ed90d44942e596a0.tar.gz python-jenkins-job-builder-71523ec35c7e39d93c115327ed90d44942e596a0.tar.xz python-jenkins-job-builder-71523ec35c7e39d93c115327ed90d44942e596a0.zip |
Use convert_mapping_to_xml helper function
'primaryView' and 'healthMetrics' attributes are generated in XML
code with the help of convert_mapping_to_xml helper function.
Change-Id: Ic68c22dfc49872c304f1540120deae237f479273
Diffstat (limited to 'jenkins_jobs/modules/project_folder.py')
-rw-r--r-- | jenkins_jobs/modules/project_folder.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/jenkins_jobs/modules/project_folder.py b/jenkins_jobs/modules/project_folder.py index 72555acc..a16a1215 100644 --- a/jenkins_jobs/modules/project_folder.py +++ b/jenkins_jobs/modules/project_folder.py @@ -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 |