Bug #12284
openhost group parameter overrides reformatting YAML values to strings
Description
Adding an override to a smart class parameter of type YAML from host groups with the value:
--- - Apple - Orange - Strawberry - Mango
results in the host edit form showing the parameter as:
--- ! '- Apple - Orange - Strawberry - Mango '
As a workaround I override it again from host.
For mor complexe yaml example you may found "\n"
Files
Updated by Dominic Cleal about 9 years ago
- Related to Bug #11375: Smart class parameters turn YAML to string when using a multi line yaml added
Updated by Dominic Cleal about 9 years ago
- Description updated (diff)
- Category set to Parameters
Updated by Dominic Cleal about 9 years ago
- Assignee deleted (
Dominic Cleal)
It's a related but definitely different to #11375 it seems.
The UI (app/views/puppetclasses/_class_parameters.html.erb and host_key_with_diagnostic helper) attempts to reverse LookupValue#value - which it expects to return a hash or array for a YAML parameter - in order to display it in the textbox. It does this essentially by calling LookupKey#value_before_type_cast(LookupValue's value) in the helper.
However it retrieves the list of LookupValues applicable to the host by calling Classification::ClassParam (via the value_hash_cache helper). In Classification::Base#update_generic_matcher, it calls LookupKey#value_before_type_cast so the value is actually the YAML string rather than the hash/array.
When this string is passed back, as above, it calls value_before_type_cast but with the YAML string, causing a second level of YAML in the textbox instead of the original one level.
Changing the behaviour of update_generic_matcher to get .value means further changes in the classification to ensure the ENC output still works (it attempts to type cast it again I think).
Updated by Hector Elenes about 9 years ago
- File after-submit.png after-submit.png added
- File before-submit.png before-submit.png added
I'm seeing this issue in 1.9.2. Attached screenshots. The current workaround is making the parameter overrides in the Puppet Class > Smart Class Parameter page.
Updated by Dominic Cleal about 9 years ago
Hector, your issue is #11375 (due for 1.9.3 tomorrow) as it's just editing/saving of overrides. This bug is specifically about overriding of a value inherited from a host group.
Updated by Hector Elenes about 9 years ago
Dominic Cleal wrote:
Hector, your issue is #11375 (due for 1.9.3 tomorrow) as it's just editing/saving of overrides. This bug is specifically about overriding of a value inherited from a host group.
Thank you Dominic!
Updated by Kerguillec Paul about 9 years ago
Hi Dominic, it's not fixed in RC3 release ?
I have also noticed the related (same ?) issue from "Default Behavior" by editing smart class parameters inside edit parameter class subsection.
Updated by Dominic Cleal about 9 years ago
Kerguillec Paul wrote:
Hi Dominic, it's not fixed in RC3 release ?
No, the issue is marked "New" so is unfixed.
Updated by Dominic Cleal almost 9 years ago
- Related to Bug #14292: Child hostgroup cloning issue with array parameters added