Update managed_script to use convert_mapping_to_xml()

Change-Id: I72fd229e157f291a80ae15555ca2dd8822a8192b
This commit is contained in:
Yolande Amate 2017-07-04 22:45:16 +01:00
parent e3e5a8aabe
commit a8610107e5
1 changed files with 2 additions and 5 deletions

View File

@ -2520,11 +2520,8 @@ def managed_script(registry, xml_parent, data):
raise InvalidAttributeError('type', step_type, ['script', 'batch'])
ms = XML.SubElement(xml_parent,
'org.jenkinsci.plugins.managedscripts.' + step)
try:
script_id = data['script-id']
except KeyError:
raise MissingAttributeError('script-id')
XML.SubElement(ms, script_tag).text = script_id
mapping = [('script-id', script_tag, None)]
convert_mapping_to_xml(ms, data, mapping, fail_required=True)
args = XML.SubElement(ms, 'buildStepArgs')
for arg in data.get('args', []):
XML.SubElement(args, 'string').text = arg