Bug #12324
closedHash and array smart parameters are getting corrupted after multiple saves
Description
I define (override) a smart parameter and made sure the correct type was set (hash or array) for a Puppet class.
Then I go to a host or hostgroup and enter a value for this parameter in YAML notation.
I can then see in the YAML output for the host that de value is displayed correctly.
Then I edit the host or hostgroup again, but now the value I've entered is quoted and or escaped.
Example: for the hash_resources class, I've overridden the resources parameter. This is the value I've entered:
dns::zone:
dap:
zonetype: slave
masters:
- 10.67.75.155
75.67.10.in-addr.arpa:
reverse: true
zonetype: slave
masters:
- 10.67.75.155
This is the value I see when I edit the host again:
--- ! "dns::zone:\r\n dap:\r\n zonetype: 'slave'\r\n masters:\r\n - 10.67.75.155\r\n
\ 75.67.10.in-addr.arpa:\r\n reverse: true\r\n zonetype: 'slave'\r\n masters:\r\n
\ - 10.67.75.155"
Trying to save a host with this value returns an error because foreman can't validate this as a correct hash, which is of course correct.
This means that when editing a host you have to reenter these values each time.
I'm currently running Foreman 1.9.2 on CentOS7, installed using the katello installer.