Hash and array smart parameters are getting corrupted after multiple saves
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:
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.
#3 Updated by Tim Verhoeven over 6 years ago
Thanks for the info. That looks indeed like the issue. But the #11375 only talks about YAML. But I see something similar with arrays.
For example, I enter:
[ "root", "oneadmin", ]
Which then becomes:
"[ \"root\", \"oneadmin\", ]"
Is this also fixed in the new release?
#5 Updated by Stefan Hölzle over 6 years ago
I had this issue with arrays. Following the instructions in comment http://projects.theforeman.org/issues/11375#note-31 fixed it for me.