Update custom_tools to use convert_to_xml()

Change-Id: I2a9c3a195c0999f8971b02bb691fd486015cfbed
This commit is contained in:
Yolande Amate 2017-07-03 18:15:01 +01:00
parent e3e5a8aabe
commit 484446ddd0
2 changed files with 9 additions and 10 deletions

View File

@ -1810,17 +1810,16 @@ def custom_tools(registry, xml_parent, data):
tool_node = base + '.CustomToolInstallWrapper_-SelectedTool'
for tool in tools:
tool_wrapper = XML.SubElement(wrapper_tools, tool_node)
XML.SubElement(tool_wrapper, 'name').text = str(tool)
mapping = [('', 'name', tool)]
convert_mapping_to_xml(tool_wrapper, data, mapping, fail_required=True)
opts = XML.SubElement(wrapper,
'multiconfigOptions')
skip_install = str(data.get('skip-master-install', 'false'))
XML.SubElement(opts,
'skipMasterInstallation').text = skip_install
mapping = [('skip-master-install', 'skipMasterInstallation', False)]
convert_mapping_to_xml(opts, data, mapping, fail_required=True)
convert_home = str(data.get('convert-homes-to-upper', 'false'))
XML.SubElement(wrapper,
'convertHomesToUppercase').text = convert_home
mapping = [('convert-homes-to-upper', 'convertHomesToUppercase', False)]
convert_mapping_to_xml(wrapper, data, mapping, fail_required=True)
def nodejs_installator(registry, xml_parent, data):

View File

@ -8,9 +8,9 @@
</com.cloudbees.jenkins.plugins.customtools.CustomToolInstallWrapper_-SelectedTool>
</selectedTools>
<multiconfigOptions>
<skipMasterInstallation>True</skipMasterInstallation>
<skipMasterInstallation>true</skipMasterInstallation>
</multiconfigOptions>
<convertHomesToUppercase>True</convertHomesToUppercase>
<convertHomesToUppercase>true</convertHomesToUppercase>
</com.cloudbees.jenkins.plugins.customtools.CustomToolInstallWrapper>
</buildWrappers>
</project>
</project>