summaryrefslogtreecommitdiffstats
path: root/jenkins_jobs/modules/general.py
diff options
context:
space:
mode:
authorMax Rydahl Andersen <manderse@redhat.com>2015-03-01 09:43:02 +0100
committerKhai Do <zaro0508@gmail.com>2015-05-02 15:42:32 -0700
commitcb876b481ed994218b21fa240a7e55a1ab99e50e (patch)
tree204097f5c9156da8baf5ed477ee767f7b0d22d88 /jenkins_jobs/modules/general.py
parentcac1a674015991434b5aab6cc162ae4ca37e338b (diff)
downloadpython-jenkins-job-builder-cb876b481ed994218b21fa240a7e55a1ab99e50e.tar.gz
python-jenkins-job-builder-cb876b481ed994218b21fa240a7e55a1ab99e50e.tar.xz
python-jenkins-job-builder-cb876b481ed994218b21fa240a7e55a1ab99e50e.zip
Add support for 'raw' to inject direct xml to job configs.
'raw' allow users to have a fallback in case a plugin is not yet supported or the plugin is not generating the expected result. Only intended as a last fallback, but useful when waiting for review to complete. Change-Id: If0d22d7d43d35649e78aa7481e1c0f1ed21a6025
Diffstat (limited to 'jenkins_jobs/modules/general.py')
-rw-r--r--jenkins_jobs/modules/general.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/jenkins_jobs/modules/general.py b/jenkins_jobs/modules/general.py
index 68cfb2bd..99fc7c03 100644
--- a/jenkins_jobs/modules/general.py
+++ b/jenkins_jobs/modules/general.py
@@ -162,3 +162,10 @@ class General(jenkins_jobs.modules.base.Base):
lr_adays.text = str(logrotate.get('artifactDaysToKeep', -1))
lr_anum = XML.SubElement(lr_xml, 'artifactNumToKeep')
lr_anum.text = str(logrotate.get('artifactNumToKeep', -1))
+
+
+def raw(parser, xml_parent, data):
+ # documented in definition.rst since includes and docs is not working well
+ # For cross cutting method like this
+ root = XML.fromstring(data.get('xml'))
+ xml_parent.append(root)