Feature #215

Allow blank values for parameters

Added by Bash Shell over 8 years ago. Updated 8 days ago.

Status:Closed
Priority:Normal
Assignee:Ori Rabin
Category:Host creation
Target version:1.6.0
Difficulty: Team Backlog:
Triaged: Fixed in Releases:
Bugzilla link:1120685 Found in Releases:
Pull request:https://github.com/theforeman/foreman/pull/1610

Description

If blank values for parameters are allowed, then one can do thing in templates like

<% !param_name.empty? -%>
<% do_some_thing -%>

This should be a pretty small change in parameter.rb .


Related issues

Duplicates Foreman - Bug #4319: Parameter with no value is not persisted in hostgroup Duplicate 02/11/2014
Duplicated by Foreman - Bug #6697: UI doesn't raise any error when we add OS parameter witho... Duplicate 07/21/2014
Duplicated by Foreman - Bug #1512: Cannot give parameter empty value Duplicate 02/28/2012

Associated revisions

Revision 32ced385
Added by Ori Rabin almost 4 years ago

Fixes #215: Parameters can be saved without a value

History

#1 Updated by Ohad Levy over 8 years ago

  • Status changed from New to Feedback
  • Assignee set to Bash Shell

Bash Shell wrote:

If blank values for parameters are allowed, then one can do thing in templates like

[...]

This should be a pretty small change in parameter.rb .

that's actually not true, as when saving the host model with the parameters (which is another model), the way to detect if there are new parameters is based on if the value is empty or not.

I'm not sure if that's such a useful feature, as you can also use:

<% if has_variable?("myvar") then %>

#2 Updated by Bash Shell over 8 years ago

Like we discussed on IRC, it would be great if users have the option of having blank values.

We use it in a couple of ways in our templates. (hard to describe, I know)

This is also valid YAML, so it would be great to have that option.

#3 Updated by Ohad Levy almost 8 years ago

the problem is that the current implementation detect the presence of parameters based on the parameter value... (e.g. it gets deleted if the value is blank).
Patches are welcomed :)

#4 Updated by Benjamin Papillon over 5 years ago

  • Status changed from Feedback to New
  • Assignee deleted (Bash Shell)

I remove the tag "feedback". Patches are always welcome :D

#5 Updated by Ohad Levy over 4 years ago

  • Duplicates Bug #4319: Parameter with no value is not persisted in hostgroup added

#6 Updated by Ohad Levy over 4 years ago

  • Status changed from New to Duplicate

#7 Updated by Ohad Levy over 4 years ago

  • Description updated (diff)
  • Status changed from Duplicate to New

#8 Updated by Ohad Levy almost 4 years ago

  • Assignee set to Ori Rabin

#9 Updated by Ori Rabin almost 4 years ago

  • Status changed from New to Ready For Testing

#10 Updated by Ori Rabin almost 4 years ago

  • Related to Bug #6697: UI doesn't raise any error when we add OS parameter without any value added

#11 Updated by Ohad Levy almost 4 years ago

  • Related to deleted (Bug #6697: UI doesn't raise any error when we add OS parameter without any value)

#12 Updated by Ohad Levy almost 4 years ago

  • Duplicated by Bug #6697: UI doesn't raise any error when we add OS parameter without any value added

#13 Updated by Ori Rabin almost 4 years ago

  • Pull request https://github.com/theforeman/foreman/pull/1610 added

#14 Updated by Dominic Cleal almost 4 years ago

  • Related to deleted (Bug #1512: Cannot give parameter empty value)

#15 Updated by Dominic Cleal almost 4 years ago

  • Duplicated by Bug #1512: Cannot give parameter empty value added

#16 Updated by Dominic Cleal almost 4 years ago

  • Category set to Host creation
  • Target version set to 1.7.5
  • Legacy Backlogs Release (now unused) set to 10

#17 Updated by Bryan Kearney almost 4 years ago

  • Bugzilla link set to 1120685

#18 Updated by Ori Rabin almost 4 years ago

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

Also available in: Atom PDF