Project

General

Profile

Actions

Bug #11862

closed

Smart variables with illegal characters raises an exception

Added by Ori Rabin about 9 years ago. Updated over 6 years ago.

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

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


Related issues 1 (0 open1 closed)

Related to Foreman - Refactor #10232: move validations and casting out of lookup keys and values into single-responsibility classesClosedTom Caspy04/22/2015Actions
Actions #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)

Actions #2

Updated by Tom Caspy about 9 years ago

Reproduction steps:
  1. edit puppetclass
  2. click on smart variable
  3. add a new smart variable of type "hash"
  4. input a hash which isn't a valid json or yaml (i.e. '{"foo" => "bar"}' or something similar)
  5. 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)

Actions #3

Updated by Ori Rabin about 9 years ago

  • Assignee changed from Tom Caspy to Ori Rabin
Actions #4

Updated by Ori Rabin about 9 years ago

  • Assignee changed from Ori Rabin to Tom Caspy
Actions #5

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.

Actions #6

Updated by Dominic Cleal about 9 years ago

  • Related to Refactor #10832: Make LookupKey an STI for puppet and variable keys added
Actions #7

Updated by Dominic Cleal about 9 years ago

  • Translation missing: en.field_release set to 63
Actions #8

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
Actions #9

Updated by Ori Rabin about 9 years ago

  • Related to deleted (Refactor #10832: Make LookupKey an STI for puppet and variable keys)
Actions #10

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 ()
Actions #11

Updated by Dominic Cleal almost 9 years ago

  • Translation missing: en.field_release changed from 63 to 104
Actions #12

Updated by Tom Caspy almost 9 years ago

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

Also available in: Atom PDF