Sharing my stoopid mistake in the hopes of saving someone else the same grief: I had a boolean toggle that was not performing as expected. Long story short: I had put quotes around the word "false" class { ''foo'' : boolFlag => "false" } was coming up TRUE To fix it, lose the quotes class { ''foo'' : boolFlag => false } “Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us.” Bill Waterson (Calvin & Hobbes) -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Brice Figureau
2011-Dec-19 16:24 UTC
Re: [Puppet Users] Learn from MY Mistake: "false" != false
On Mon, 2011-12-19 at 16:14 +0000, Dan White wrote:> Sharing my stoopid mistake in the hopes of saving someone else the same grief: > > I had a boolean toggle that was not performing as expected. > > Long story short: I had put quotes around the word "false" > > class { ''foo'' : boolFlag => "false" } was coming up TRUE > > To fix it, lose the quotes > class { ''foo'' : boolFlag => false }It all depends what is done with boolFlag in your parametrized class. More specifically what doesn''t work is: if "false" { } Because a string when (internally) converted to a boolean is true. This was discussed 2 days ago (look when the thread changes name): http://groups.google.com/group/puppet-users/browse_thread/thread/3dfba6566d97880e/c473deea3f302410?# And this is tracked in the following bug: http://projects.puppetlabs.com/issues/5648 -- Brice Figureau Follow the latest Puppet Community evolutions on www.planetpuppet.org! -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Dan White
2011-Dec-19 17:27 UTC
Re: [Puppet Users] Learn from MY Mistake: "false" != false
Thanks for pointing that out for two reasons: (1) In the flow of the mailing list, simple little tricks like this can flash right past you if you are not reading carefully. (2) That thread gave me a better approach for what I am doing in my class. Thanks again, everyone ! “Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us.” Bill Waterson (Calvin & Hobbes) ----- Brice Figureau <brice-puppet@daysofwonder.com> wrote:> On Mon, 2011-12-19 at 16:14 +0000, Dan White wrote: > > Sharing my stoopid mistake in the hopes of saving someone else the same grief: > > > > I had a boolean toggle that was not performing as expected. > > > > Long story short: I had put quotes around the word "false" > > > > class { ''foo'' : boolFlag => "false" } was coming up TRUE > > > > To fix it, lose the quotes > > class { ''foo'' : boolFlag => false } > > It all depends what is done with boolFlag in your parametrized class. > More specifically what doesn''t work is: > > if "false" { > } > > Because a string when (internally) converted to a boolean is true. > > This was discussed 2 days ago (look when the thread changes name): > http://groups.google.com/group/puppet-users/browse_thread/thread/3dfba6566d97880e/c473deea3f302410?# > > And this is tracked in the following bug: > http://projects.puppetlabs.com/issues/5648 > > -- > Brice Figureau > Follow the latest Puppet Community evolutions on www.planetpuppet.org! > > -- > You received this message because you are subscribed to the Google Groups "Puppet Users" group. > To post to this group, send email to puppet-users@googlegroups.com. > To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en. >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
James Turnbull
2011-Dec-19 23:57 UTC
Re: [Puppet Users] Learn from MY Mistake: "false" != false
Dan White wrote:> Thanks for pointing that out for two reasons: > (1) In the flow of the mailing list, simple little tricks like this can flash right past you if you are not reading carefully. > (2) That thread gave me a better approach for what I am doing in my class. > > Thanks again, everyone ! >This is an excellent example of something that could be caught by linting until the bug is fixed: https://github.com/rodjek/puppet-lint/issues/43 Regards James -- James Turnbull Puppet Labs 1-503-734-8571 To schedule a meeting with me: http://tungle.me/jamtur01 -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Henrik Lindberg
2011-Dec-20 01:54 UTC
Re: [Puppet Users] Learn from MY Mistake: "false" != false
On 2011-20-12 24:57, James Turnbull wrote:> Dan White wrote: >> Thanks for pointing that out for two reasons: >> (1) In the flow of the mailing list, simple little tricks like this can flash right past you if you are not reading carefully. >> (2) That thread gave me a better approach for what I am doing in my class. > > This is an excellent example of something that could be caught by > linting until the bug is fixed: > > https://github.com/rodjek/puppet-lint/issues/43And ditto for Geppetto. I added this check and will be available in Geppetto 2.1.2 (it is user configurable ignore/warning/error) under Potential Problems preferences. Regards - henrik -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.