Convert parameter default value to str
This resolves the error "TypeError: cannot serialize 1 (type int)" when using a parameter inside of a macro and then passing an integer value to the macro. For example: - parameter: name: int-param parameters: - string: name: VAR_INT default: '{var}' - job-template: name: int-param parameters: - int-param: var: 1 Change-Id: Ie3a5d2e03b7aa0b7cafdb467cd0118e4ff6e73bc Signed-off-by: Thanh Ha <zxiiro@linux.com>
This commit is contained in:
parent
d29998eaa9
commit
b06b5f2239
@ -48,7 +48,7 @@ def base_param(registry, xml_parent, data, do_default, ptype):
|
||||
if do_default:
|
||||
default = data.get('default', None)
|
||||
if default:
|
||||
XML.SubElement(pdef, 'defaultValue').text = default
|
||||
XML.SubElement(pdef, 'defaultValue').text = str(default)
|
||||
else:
|
||||
XML.SubElement(pdef, 'defaultValue')
|
||||
return pdef
|
||||
|
Loading…
x
Reference in New Issue
Block a user