Account for boolean OVF properties (#45529)

Currently, Ansible interprets variables with a True|False value as
boolean. This causes the vmware_deploy_ovf module to break, because
it can only accept string values as properties.

This fix checks if a value is boolean, and converts it to a string
if it is. Since integers do not seem to be causing the same error, this
is the only check we appear to need.

After completion, OVF properties that are boolean can be specified as
yes|no or true|false.

Closes: #45528
This commit is contained in:
Jay Jahns 2018-10-08 05:14:58 -05:00 committed by ansibot
parent 5255d52f15
commit ffcebd317b

View file

@ -343,7 +343,7 @@ class VMwareDeployOvf:
for key, value in self.params['properties'].items():
property_mapping = vim.KeyValue()
property_mapping.key = key
property_mapping.value = value
property_mapping.value = str(value) if isinstance(value, bool) else value
params['propertyMapping'].append(property_mapping)
if self.params['folder']: