You've already forked community.general
mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-29 07:41:16 +03:00
one_vm: fix syntax error when creating VMs with a more complex template (#6294)
* one_vm: fix syntax error when creating VMs with a more complex template with more complex templates that make use of quoted strings the new "render" method fails to produce a template that is accepted by OpenNebula. ==> escape double quotes in strings to make OpenNebula happy again. I also tested whether newlines need to be escaped, looks like they are fine as they are. Fixes #6225 * module_utils/opennebula: skip empty values in render
This commit is contained in:
@ -75,6 +75,18 @@ RENDER_VALID = [
|
||||
NIC=[NAME="NIC1",NETWORK_ID="1"]
|
||||
''').strip()
|
||||
),
|
||||
(
|
||||
{
|
||||
'EMPTY_VALUE': None,
|
||||
'SCHED_REQUIREMENTS': 'CLUSTER_ID="100"',
|
||||
'BACKSLASH_ESCAPED': "this is escaped: \\n; this isn't: \"\nend",
|
||||
},
|
||||
textwrap.dedent('''
|
||||
BACKSLASH_ESCAPED="this is escaped: \\\\n; this isn't: \\"
|
||||
end"
|
||||
SCHED_REQUIREMENTS="CLUSTER_ID=\\"100\\""
|
||||
''').strip()
|
||||
),
|
||||
]
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user