summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVeluri Mithun <velurimithun38@gmail.com>2018-05-30 11:15:59 +0530
committerVeluri Mithun <velurimithun38@gmail.com>2018-06-09 18:00:54 +0530
commit71523ec35c7e39d93c115327ed90d44942e596a0 (patch)
treebf8aa3230810d3c0dc5244a50717b8661f78afd2
parent307c09cff3ef030a72859cdc63ce555810af486d (diff)
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
Notes
Notes (review): Code-Review+2: Thanh Ha <zxiiro@gmail.com> Code-Review+2: Kien Ha <kienha9922@gmail.com> Workflow+1: Kien Ha <kienha9922@gmail.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Mon, 11 Jun 2018 01:35:40 +0000 Reviewed-on: https://review.openstack.org/571096 Project: openstack-infra/jenkins-job-builder Branch: refs/heads/master
-rw-r--r--jenkins_jobs/modules/project_folder.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/jenkins_jobs/modules/project_folder.py b/jenkins_jobs/modules/project_folder.py
index 72555ac..a16a121 100644
--- a/jenkins_jobs/modules/project_folder.py
+++ b/jenkins_jobs/modules/project_folder.py
@@ -36,6 +36,7 @@ Job template example:
36 36
37import xml.etree.ElementTree as XML 37import xml.etree.ElementTree as XML
38import jenkins_jobs.modules.base 38import jenkins_jobs.modules.base
39from jenkins_jobs.modules.helpers import convert_mapping_to_xml
39 40
40 41
41class Folder(jenkins_jobs.modules.base.Base): 42class Folder(jenkins_jobs.modules.base.Base):
@@ -50,7 +51,11 @@ class Folder(jenkins_jobs.modules.base.Base):
50 XML.SubElement(xml_parent, 'views') 51 XML.SubElement(xml_parent, 'views')
51 attributes = {"class": "hudson.views.DefaultViewsTabBar"} 52 attributes = {"class": "hudson.views.DefaultViewsTabBar"}
52 XML.SubElement(xml_parent, 'viewsTabBar', attrib=attributes) 53 XML.SubElement(xml_parent, 'viewsTabBar', attrib=attributes)
53 XML.SubElement(xml_parent, 'primaryView').text = 'All' 54
54 XML.SubElement(xml_parent, 'healthMetrics') 55 mappings = [
56 ('', 'primaryView', 'All'),
57 ('', 'healthMetrics', ''),
58 ]
59 convert_mapping_to_xml(xml_parent, data, mappings, True)
55 60
56 return xml_parent 61 return xml_parent