summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYolande Amate <yolandeamate@gmail.com>2017-07-03 03:42:45 +0100
committerYolande Amate <yolandeamate@gmail.com>2017-07-03 03:42:45 +0100
commit47e6a03c78199754722791ad1e0d9635cf0d62d0 (patch)
tree4fc93b5b09f75baea8d64f37853a2794aff0bec2
parent7adf73ef1bee9557cc196742cc79fd8f42f3c584 (diff)
downloadpython-jenkins-job-builder-47e6a03c78199754722791ad1e0d9635cf0d62d0.tar.gz
python-jenkins-job-builder-47e6a03c78199754722791ad1e0d9635cf0d62d0.tar.xz
python-jenkins-job-builder-47e6a03c78199754722791ad1e0d9635cf0d62d0.zip
Update _groovy_common_scriptSource to use convert_xml()
Change-Id: I727542f9de98ecfb42ef3580e789163f6277ef52
-rw-r--r--jenkins_jobs/modules/builders.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/jenkins_jobs/modules/builders.py b/jenkins_jobs/modules/builders.py
index a41e6d1b..46e8d17d 100644
--- a/jenkins_jobs/modules/builders.py
+++ b/jenkins_jobs/modules/builders.py
@@ -1084,12 +1084,12 @@ def _groovy_common_scriptSource(data):
raise JenkinsJobsException("Use just one of 'command' or 'file'")
if 'command' in data:
- command = XML.SubElement(scriptSource, 'command')
- command.text = str(data['command'])
+ mapping = [('command', 'command', None)]
+ convert_mapping_to_xml(scriptSource, data, mapping, fail_required=True)
scriptSource.set('class', 'hudson.plugins.groovy.StringScriptSource')
elif 'file' in data:
- scriptFile = XML.SubElement(scriptSource, 'scriptFile')
- scriptFile.text = str(data['file'])
+ mapping = [('file', 'scriptFile', None)]
+ convert_mapping_to_xml(scriptSource, data, mapping, fail_required=True)
scriptSource.set('class', 'hudson.plugins.groovy.FileScriptSource')
else:
raise JenkinsJobsException("A groovy command or file is required")