Merge "jclouds: Utilize convert_mapping_to_xml"
This commit is contained in:
commit
3e4c4afa29
|
@ -1203,6 +1203,11 @@ def jclouds(registry, xml_parent, data):
|
|||
:language: yaml
|
||||
|
||||
"""
|
||||
mapping = [
|
||||
('cloud-name', 'cloudName', ''),
|
||||
('count', 'count', '1'),
|
||||
('stop-on-terminate', 'suspendOrTerminate', False),
|
||||
]
|
||||
if 'instances' in data:
|
||||
buildWrapper = XML.SubElement(
|
||||
xml_parent, 'jenkins.plugins.jclouds.compute.JCloudsBuildWrapper')
|
||||
|
@ -1213,12 +1218,8 @@ def jclouds(registry, xml_parent, data):
|
|||
'jenkins.plugins.jclouds.compute.'
|
||||
'InstancesToRun')
|
||||
XML.SubElement(instance, 'templateName').text = template
|
||||
XML.SubElement(instance, 'cloudName').text = \
|
||||
params.get('cloud-name', '')
|
||||
XML.SubElement(instance, 'count').text = \
|
||||
str(params.get('count', 1))
|
||||
XML.SubElement(instance, 'suspendOrTerminate').text = \
|
||||
str(params.get('stop-on-terminate', False)).lower()
|
||||
helpers.convert_mapping_to_xml(
|
||||
instance, params, mapping, fail_required=False)
|
||||
if data.get('single-use'):
|
||||
XML.SubElement(xml_parent,
|
||||
'jenkins.plugins.jclouds.compute.'
|
||||
|
|
Loading…
Reference in New Issue