Project

General

Profile

Actions

Bug #12284

open

host group parameter overrides reformatting YAML values to strings

Added by Kerguillec Paul over 8 years ago. Updated over 8 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Parameters
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

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

before-submit.png View before-submit.png 135 KB Hector Elenes, 10/30/2015 09:15 PM
after-submit.png View after-submit.png 149 KB Hector Elenes, 10/30/2015 09:15 PM

Related issues 2 (0 open2 closed)

Related to Foreman - Bug #11375: Smart class parameters turn YAML to string when using a multi line yamlClosedDominic Cleal08/16/2015Actions
Related to Foreman - Bug #14292: Child hostgroup cloning issue with array parametersResolvedActions
Actions #1

Updated by Dominic Cleal over 8 years ago

  • Related to Bug #11375: Smart class parameters turn YAML to string when using a multi line yaml added
Actions #2

Updated by Dominic Cleal over 8 years ago

  • Description updated (diff)
  • Category set to Parameters
Actions #3

Updated by Dominic Cleal over 8 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 over 8 years ago

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.

Actions #5

Updated by Dominic Cleal over 8 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.

Actions #6

Updated by Hector Elenes over 8 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!

Actions #7

Updated by Kerguillec Paul over 8 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.

Actions #8

Updated by Dominic Cleal over 8 years ago

Kerguillec Paul wrote:

Hi Dominic, it's not fixed in RC3 release ?

No, the issue is marked "New" so is unfixed.

Actions #9

Updated by Dominic Cleal about 8 years ago

  • Related to Bug #14292: Child hostgroup cloning issue with array parameters added
Actions

Also available in: Atom PDF