Project

General

Profile

Actions

Bug #8052

closed

Smart class parameters with ERB snippets are broken for other that String types

Added by Petr Chalupa over 9 years ago. Updated almost 6 years ago.

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

Description

Smart class parameters currently have broken validation and type-casting when used with ERB snippets. It tries to validate the value with the ERB without evaluation when key is being saved. It was hacked around it in Staypuft. How to fix it: Validation and type-casting has to be done on classification when ERB can be evaluated; SafeRender needs to be aware of the ERB parameters, they need to be validated and properly type-casted based on the given KeyValue (this association is missing currently).

The hack for Staypuft is in this file https://github.com/theforeman/staypuft/blob/master/app/models/staypuft/concerns/lookup_key_extensions.rb


Related issues 5 (1 open4 closed)

Related to Foreman - Refactor #9142: Unify validate_regexp and validate_list for lookup value/keyDuplicate01/28/2015Actions
Related to Foreman - Bug #10088: Smart class default parameter interpreted as stringNew04/08/2015Actions
Related to Foreman - Bug #9673: YAML type casting fails for lookup values in 1.7.3ClosedMarek Hulán03/06/2015Actions
Related to Foreman - Bug #9787: Default values of smart class parameters can't be JSON or YAMLClosedMarek Hulán03/16/2015Actions
Blocked by Foreman - Bug #9044: Tests can fail randomly on mac.succClosedMarek Hulán01/20/2015Actions
Actions

Also available in: Atom PDF