From 484446ddd0e7603ba3e811c7301c4fc5b54a2999 Mon Sep 17 00:00:00 2001 From: Yolande Amate Date: Mon, 3 Jul 2017 18:15:01 +0100 Subject: [PATCH] Update custom_tools to use convert_to_xml() Change-Id: I2a9c3a195c0999f8971b02bb691fd486015cfbed --- jenkins_jobs/modules/wrappers.py | 13 ++++++------- tests/wrappers/fixtures/custom-tools001.xml | 6 +++--- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/jenkins_jobs/modules/wrappers.py b/jenkins_jobs/modules/wrappers.py index 17f45e7c9..7411a909a 100644 --- a/jenkins_jobs/modules/wrappers.py +++ b/jenkins_jobs/modules/wrappers.py @@ -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): diff --git a/tests/wrappers/fixtures/custom-tools001.xml b/tests/wrappers/fixtures/custom-tools001.xml index 97fd01c3b..6e7c6438c 100644 --- a/tests/wrappers/fixtures/custom-tools001.xml +++ b/tests/wrappers/fixtures/custom-tools001.xml @@ -8,9 +8,9 @@ - True + true - True + true - \ No newline at end of file +