Feature #1425
Support for booleans in parameters
| Status: | New | Start: | 01/03/2012 | |
|---|---|---|---|---|
| Priority: | Normal | Due date: | ||
| Assigned to: | % Done: | 0% |
||
| Category: | External Nodes | |||
| Target version: | - | |||
| Backlog: | No | Difficulity: | ||
| Votes: | 2 (View) |
Description
Hi
We had failures with our modules which depend on true/false as booleans (a string of "false" is still true...).
I just tested the support in puppet for booleans and it works.
How I tested this:
# site.pp
if $test == false {
notice('$test is false')
}
if $test == true {
notice('$test is true')
}
notice("\$test is $test (2nd)")
# node terminus output
---
parameters:
test: false
This gives me the following in syslog:
# syslog Jan 3 12:14:44 puppetdev puppet-master[6259]: (Scope(Class[main])) $test is false Jan 3 12:14:44 puppetdev puppet-master[6259]: (Scope(Class[main])) $test is false
I would suggest to add support for such things in the "Add parameters" form. Something like a drop-down to define the type (Boolean) and another drop-down for the value (true/false). This could be easily extended to be used for arrays/hashes as well...
As you can easily save such things via ActiveRecord, it should not be a problem on the database side. You just need to add another field and use 'serialize :fieldname' (see "Saving arrays, hashes, and other non-mappable objects in text columns" at http://api.rubyonrails.org/classes/ActiveRecord/Base.html).
Please tell me if you need some code or so...
