Bug #11862
closedSmart variables with illegal characters raises an exception
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
Updated by Dominic Cleal about 9 years ago
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)
Updated by Tom Caspy about 9 years ago
- 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)
Updated by Ori Rabin about 9 years ago
- Assignee changed from Tom Caspy to Ori Rabin
Updated by Ori Rabin about 9 years ago
- Assignee changed from Ori Rabin to Tom Caspy
Updated by Ori Rabin about 9 years ago
In 1.9 this was invalid for a hash but you would get a validation message and not an exception.
Updated by Dominic Cleal about 9 years ago
- Related to Refactor #10832: Make LookupKey an STI for puppet and variable keys added
Updated by Dominic Cleal about 9 years ago
- Translation missing: en.field_release set to 63
Updated by Ori Rabin about 9 years ago
- Related to Refactor #10232: move validations and casting out of lookup keys and values into single-responsibility classes added
Updated by Ori Rabin about 9 years ago
- Related to deleted (Refactor #10832: Make LookupKey an STI for puppet and variable keys)
Updated by The Foreman Bot about 9 years ago
- Status changed from Assigned to Ready For Testing
- Pull request https://github.com/theforeman/foreman/pull/2748 added
- Pull request deleted (
)
Updated by Dominic Cleal almost 9 years ago
- Translation missing: en.field_release changed from 63 to 104
Updated by Tom Caspy almost 9 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset 706de3cff65f9d9f549f077bf9be7560fd61233f.