Project

General

Profile

Actions

Bug #11375

closed

Smart class parameters turn YAML to string when using a multi line yaml

Added by Ori Rabin over 8 years ago. Updated over 5 years ago.

Status:
Closed
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 with the value:
test:
example: hello

results in the host edit form showing the parameter as: --- ! "test: \nexample: hello\n"


Files

deep_merge_exception.txt deep_merge_exception.txt 24.3 KB Anthony Lapenna, 10/27/2015 07:10 AM

Related issues 8 (2 open6 closed)

Related to Foreman - Tracker #4470: Usability of parameters and overridesNew

Actions
Related to Foreman - Bug #11782: Puppet override with invalid hash array doesn't give errorClosedDominic Cleal09/11/2015Actions
Related to Foreman - Bug #12095: Smart Class Parameters mangle erb interpolated variablesClosedDominic Cleal10/07/2015Actions
Related to Foreman - Bug #12284: host group parameter overrides reformatting YAML values to stringsNew10/23/2015Actions
Has duplicate Foreman - Bug #11830: Different results when adding a parameter override from a hostgroup vs puppet class directlyDuplicate09/15/2015Actions
Has duplicate Foreman - Bug #11962: Override of Host-Parameter is saved malformedDuplicate09/25/2015Actions
Has duplicate Foreman - Bug #12191: Array-typed smart parameters changed to broken JSONDuplicate10/15/2015Actions
Has duplicate Foreman - Bug #12324: Hash and array smart parameters are getting corrupted after multiple savesDuplicate10/27/2015Actions
Actions #1

Updated by Ori Rabin over 8 years ago

  • Related to Tracker #4470: Usability of parameters and overrides added
Actions #2

Updated by Dominic Cleal over 8 years ago

  • Category set to Parameters
Actions #3

Updated by Dominic Cleal over 8 years ago

  • translation missing: en.field_release set to 91
Actions #4

Updated by Dominic Cleal over 8 years ago

  • Has duplicate Bug #11830: Different results when adding a parameter override from a hostgroup vs puppet class directly added
Actions #5

Updated by Dominic Cleal over 8 years ago

This seems to be because of the :validate => false on the association in host_common to lookup_value. The validation's necessary to cast the value correctly - and also to fix issues such as #11782.

Actions #6

Updated by Dominic Cleal over 8 years ago

  • Related to Bug #11782: Puppet override with invalid hash array doesn't give error added
Actions #7

Updated by Dominic Cleal over 8 years ago

  • Status changed from New to Assigned
  • Assignee set to Dominic Cleal
  • translation missing: en.field_release deleted (91)
Actions #8

Updated by The Foreman Bot over 8 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/2755 added
  • Pull request deleted ()
Actions #9

Updated by Dominic Cleal over 8 years ago

  • Has duplicate Bug #11962: Override of Host-Parameter is saved malformed added
Actions #10

Updated by Julien Pivotto over 8 years ago

Why did you delete Release (1.9.3)? this is a very annoying bug and the PR has lots of conflicts with 1.9 branch so it would be great to see this backported properly in 1.9. Thanks :)

Actions #11

Updated by Julien Pivotto over 8 years ago

The blocking problem is that each time you save the host (e.g change anything on the host and click save) the smart parameters are malformed

Actions #12

Updated by Dominic Cleal over 8 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100
Actions #13

Updated by Dominic Cleal over 8 years ago

  • translation missing: en.field_release set to 63
Actions #14

Updated by Dominic Cleal over 8 years ago

Julien Pivotto wrote:

Why did you delete Release (1.9.3)?

I mistakenly thought it was a new, 1.9 regression, but it wasn't.

this is a very annoying bug and the PR has lots of conflicts with 1.9 branch so it would be great to see this backported properly in 1.9. Thanks :)

Yeah, I will investigate this but at the moment I don't have the time to make sure it works properly. The implementation of overrides between 1.10 and 1.9 is different in a few places, so I'm not sure if the fix will introduce further bugs in 1.9 - it's going to need some testing. For now I'm placing it on 1.10.

Actions #15

Updated by Dominic Cleal over 8 years ago

  • Related to Bug #12095: Smart Class Parameters mangle erb interpolated variables added
Actions #16

Updated by Anthony Lapenna over 8 years ago

+1 really annoying bug, would be nice if the fix could be release in 1.9.

Actions #17

Updated by Vladimir Stackov over 8 years ago

+1 for 1.9 backport.

Actions #18

Updated by Dominic Cleal over 8 years ago

  • translation missing: en.field_release changed from 63 to 91

No promises, but I'll move it to make sure it appears on the right TODO list. Hopefully the backport's possible.

Actions #19

Updated by Anonymous over 8 years ago

  • Has duplicate Bug #12191: Array-typed smart parameters changed to broken JSON added
Actions #20

Updated by Julien Pivotto over 8 years ago

The problem is the same for hostgroups. You can not save hostgroup without breaking the smart variables.

Actions #21

Updated by larry campbell over 8 years ago

Is this fix found in 1.10.0-RC1?

Actions #22

Updated by Dominic Cleal over 8 years ago

larry campbell wrote:

Is this fix found in 1.10.0-RC1?

Yes.

Actions #23

Updated by Dominic Cleal over 8 years ago

  • Related to Bug #12284: host group parameter overrides reformatting YAML values to strings added
Actions #24

Updated by Anthony Lapenna over 8 years ago

Btw, once your parameters are 'corrupted' you'll not be able to edit your host or even access the YML dump.

See the attached file for more details about the stacktrace.

Actions #25

Updated by Dominic Cleal over 8 years ago

  • Has duplicate Bug #12324: Hash and array smart parameters are getting corrupted after multiple saves added
Actions #26

Updated by Anonymous over 8 years ago

Dominic Cleal wrote:

No promises, but I'll move it to make sure it appears on the right TODO list. Hopefully the backport's possible.

Will this make it to 1.9.3?

Actions #27

Updated by Dominic Cleal over 8 years ago

Alyssa H wrote:

Will this make it to 1.9.3?

Yep, seems to be working fine! I hope to get .3 out early next week as we've got pretty much everything I hoped for.

Actions #28

Updated by Vladimir Stackov over 8 years ago

Hallelujah! Thanks Dominic!

Actions #29

Updated by Tim Verhoeven over 8 years ago

I've just upgrade my 1.9.2 install to 1.9.3. But it seems that the issue isn't fixed in 1.9.3. I'm still having the issue. Could somebody else test and verify?

Actions #30

Updated by Anthony Lapenna over 8 years ago

We're still having this issue but with array type parameters only.

Actions #31

Updated by Brad Cowie over 8 years ago

It seems like 1.9.3 fixed it for me when using arrays on the host/group override page.

I did initially have trouble updating overrides that had previously been escaped and stored in the db. Try fixing your overrides manually in the puppet classes page and then when the correct unescaped version of the override is stored in the db try again from the host/group override page.

Actions #32

Updated by Vincent Miszczak about 8 years ago

I still have the issue in 1.10 for a host belonging to a nested group.
Group have original multi line yaml->NestedGroup inherits->Host inherits->broken yaml

Actions #33

Updated by Ben Bettridge almost 8 years ago

This also impacts me on 1.11.1.

Actions

Also available in: Atom PDF