Add functionality to set hidden properties. Fixes #50299

This commit is contained in:
Matt Martz 2019-01-11 11:51:27 -06:00
parent 8a2d39bcb2
commit 4b41bb7520

View file

@ -56,6 +56,12 @@ options:
default: thin
description:
- Disk provisioning type.
enable_hidden_properties:
description:
- Enable source properties that are marked as ovf:userConfigurable=false
default: "no"
type: bool
version_added: "2.8"
fail_on_spec_warnings:
description:
- Cause the module to treat OVF Import Spec warnings as errors.
@ -377,6 +383,10 @@ class VMwareDeployOvf:
spec_params
)
if self.params['enable_hidden_properties']:
for prop in self.import_spec.importSpec.configSpec.vAppConfig.property:
prop.info.userConfigurable = True
errors = [to_native(e.msg) for e in getattr(self.import_spec, 'error', [])]
if self.params['fail_on_spec_warnings']:
errors.extend(
@ -543,6 +553,10 @@ def main():
'deployment_option': {
'default': None,
},
'enable_hidden_properties': {
'default': False,
'type': 'bool',
},
'folder': {
'default': None,
},