Issue #5648 has been updated by Nigel Kersten. Status changed from Accepted to Needs More Information Assignee changed from Randall Hansen to Daniel Pittman
I'm not quite sure this should provoke a warning. I've definitely seen manifests where a string value could be "false" but the check as expressed above is actually what the user wants to check, as they're wanting to check for existence without specifying a value. Daniel, what do you envisage happening when we have true booleans from Facter available in Puppet? ---------------------------------------- Feature #5648: Puppet should emit a warning when literal string "true" or "false" is used in a boolean context https://projects.puppetlabs.com/issues/5648 Author: Daniel Pittman Status: Needs More Information Priority: Low Assignee: Daniel Pittman Category: compiler Target version: Affected Puppet version: Keywords: Branch: In the puppet universe the strings "true" and "false" are "boolean true", which means that there are some cases where it will be highly unintuitive. It would be nice if puppet would emit a warning in this case: if "false" { ... } else { ... } => "warning: the string 'false' evaluates as true, did you mean false instead?" However, this should not emit a warning, I strongly suspect: $foo = "false" if $foo { ... } else { ... } That should make this detectable, but wrong, code let people know that it won't do what they expected. The "string literal" case is pretty much unambiguously expecting the wrong thing, I expect, or at least super-confusing to someone else reading it later. :) -- You have received this notification because you have either subscribed to it, or are involved in it. To change your notification preferences, please click here: http://projects.puppetlabs.com/my/account -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/puppet-bugs?hl=en.
