Project

General

Profile

Actions

Bug #14476

closed

Caster fails with incorrect exception trying to cast invalid real from string

Added by Tomer Brisker about 8 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

attempting to cast a string that isn't a valid real number leads to the exception:

Error while parsing smartvar
 | NoMethodError: undefined method `cast_value_integer' for #<Foreman::Parameters::Caster:0x000000107a4da0>
 | /home/tbrisker/foreman/app/services/foreman/parameters/caster.rb:84:in `cast_real'
 | /home/tbrisker/foreman/app/services/foreman/parameters/caster.rb:33:in `casted_value'
 | /home/tbrisker/foreman/app/services/foreman/parameters/caster.rb:17:in `cast!'
 | /home/tbrisker/foreman/app/models/lookup_value.rb:71:in `validate_and_cast_value'
... snipped rest of stacktrace


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 The Foreman Bot about 8 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/3390 added
Actions #2

Updated by Anonymous about 8 years ago

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

Updated by Dominic Cleal about 8 years ago

  • Related to Refactor #10232: move validations and casting out of lookup keys and values into single-responsibility classes added
Actions #4

Updated by Dominic Cleal about 8 years ago

  • Category set to Parameters
  • translation missing: en.field_release set to 141
Actions

Also available in: Atom PDF