Project

General

Profile

Feature #215

Allow blank values for parameters

Added by Bash Shell almost 13 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Host creation
Target version:
Difficulty:
Triaged:
Bugzilla link:
Fixed in Releases:
Found in Releases:
Red Hat JIRA:

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

Is duplicate of Foreman - Bug #4319: Parameter with no value is not persisted in hostgroupDuplicate2014-02-11
Has duplicate Foreman - Bug #6697: UI doesn't raise any error when we add OS parameter without any valueDuplicate2014-07-21
Has duplicate Foreman - Bug #1512: Cannot give parameter empty valueDuplicate2012-02-28

Associated revisions

Revision 32ced385 (diff)
Added by Ori Rabin over 8 years ago

Fixes #215: Parameters can be saved without a value

History

#1 Updated by Ohad Levy almost 13 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 almost 13 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 over 12 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 10 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 about 9 years ago

  • Is duplicate of Bug #4319: Parameter with no value is not persisted in hostgroup added

#6 Updated by Ohad Levy about 9 years ago

  • Status changed from New to Duplicate

#7 Updated by Ohad Levy about 9 years ago

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

#8 Updated by Ohad Levy over 8 years ago

  • Assignee set to Ori Rabin

#9 Updated by Ori Rabin over 8 years ago

  • Status changed from New to Ready For Testing

#10 Updated by Ori Rabin over 8 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 over 8 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 over 8 years ago

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

#13 Updated by Ori Rabin over 8 years ago

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

#14 Updated by Dominic Cleal over 8 years ago

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

#15 Updated by Dominic Cleal over 8 years ago

  • Has duplicate Bug #1512: Cannot give parameter empty value added

#16 Updated by Dominic Cleal over 8 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 over 8 years ago

  • Bugzilla link set to 1120685

#18 Updated by Ori Rabin over 8 years ago

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

Also available in: Atom PDF