Re: [Puppet Users] Learn from MY Mistake: false != false

2011-12-19 Thread Brice Figureau
On Mon, 2011-12-19 at 16:14 +, 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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Learn from MY Mistake: false != false

2011-12-19 Thread Dan White
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-pup...@daysofwonder.com wrote:
 On Mon, 2011-12-19 at 16:14 +, 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+unsubscr...@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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Learn from MY Mistake: false != false

2011-12-19 Thread James Turnbull
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Learn from MY Mistake: false != false

2011-12-19 Thread Henrik Lindberg

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/43


And 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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.