Bug #11862
closed
Smart variables with illegal characters raises an exception
Added by Ori Rabin about 9 years ago.
Updated over 6 years ago.
Description
For example using rocket hash instead of json:
1) create a smart variable of type hash
2) change default value to: {'a'=>'b'}
3) try to save
there should be a validation message that this is not a valid json/yaml but an exception is received:
(<unknown>): did not find expected ',' or '}' while parsing a flow mapping at line 1 column 1
I can't reproduce this to determine if it's a regression. All of my attempts simply fail validation on the default value field. Could you confirm when it was introduced please, and some more details about how to reproduce? (e.g. which UI or API, logs, stack trace)
Reproduction steps:
- edit puppetclass
- click on smart variable
- add a new smart variable of type "hash"
- input a hash which isn't a valid json or yaml (i.e. '{"foo" => "bar"}' or something similar)
- submit and see exception
Expected result - show a validation message saying this isn't a valid hash.
Expected UX - have a key-value editor which turns into a valid json on submit and save the user the trouble (out of scope of this ticket but idea worth mentioning)
- Assignee changed from Tom Caspy to Ori Rabin
- Assignee changed from Ori Rabin to Tom Caspy
In 1.9 this was invalid for a hash but you would get a validation message and not an exception.
- Related to Refactor #10832: Make LookupKey an STI for puppet and variable keys added
- Translation missing: en.field_release set to 63
- Related to Refactor #10232: move validations and casting out of lookup keys and values into single-responsibility classes added
- Related to deleted (Refactor #10832: Make LookupKey an STI for puppet and variable keys)
- Status changed from Assigned to Ready For Testing
- Pull request https://github.com/theforeman/foreman/pull/2748 added
- Pull request deleted (
)
- Translation missing: en.field_release changed from 63 to 104
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Also available in: Atom
PDF