Jira (PUP-2371) Truthiness and nullness

2014-06-10 Thread Daniele Sluijters (JIRA)
Title: Message Title










 

 Daniele Sluijters commented on an issue


















  Re: Truthiness and nullness 










I don't think so. It was a good place to collect some information about the current state though.












   

 Add Comment

























 Puppet /  PUP-2371



  Truthiness and nullness 







 Puppet's definition of what is truly True, False or Nil is completely insane. Now that Puppet 4 has opened up I think it's a good time to fix this, once and for all.   The problem has recently hit me in Types and Providers where trying to use Boolean parameters and properties is just impossible because the RAL in a lot of places checks for truthiness ins...















 This message was sent by Atlassian JIRA (v6.1.4#6159-sha1:44eaede)




 














-- 
You received this message because you are subscribed to the Google Groups Puppet Bugs group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-bugs@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-2371) Truthiness and nullness

2014-06-09 Thread Henrik Lindberg (JIRA)
Title: Message Title










 

 Henrik Lindberg commented on an issue


















  Re: Truthiness and nullness 










This issue has started to sprawl... I don't know what it is about any longer. We do want to rewrite the catalog / resource / type subsystem and have an epic and designs for that. We have separate issues for undef vs. empty string, and handling of booleans in types - there are also other specific issues linked in.
I guess I am asking, Do we really need this umbrella ticket? (it is a very large umbrella )












   

 Add Comment

























 Puppet /  PUP-2371



  Truthiness and nullness 







 Puppet's definition of what is truly True, False or Nil is completely insane. Now that Puppet 4 has opened up I think it's a good time to fix this, once and for all.   The problem has recently hit me in Types and Providers where trying to use Boolean parameters and properties is just impossible because the RAL in a lot of places checks for truthiness ins...















 This message was sent by Atlassian JIRA (v6.1.4#6159-sha1:44eaede)




 














-- 
You received this message because you are subscribed to the Google Groups Puppet Bugs group.
To unsubscribe from this group and stop receiving emails from it, 

Jira (PUP-2371) Truthiness and nullness

2014-04-29 Thread Daniele Sluijters (JIRA)
Title: Message Title










 

 Daniele Sluijters commented on an issue


















  Re: Truthiness and nullness 










As an example for Type/Providers insanity:


  newproperty(:anything) do
newvalues(true, false)
defaultto false
  end



But on the provider side you don't get false, you get :false. If you try to fix this by using require 'puppet/property/boolean` and setting the property to boolean you hit PUP-2368, parameters have similar weirdness.












   

 Add Comment

























 Puppet /  PUP-2371



  Truthiness and nullness 







 Puppet's definition of what is truly True, False or Nil is completely insane. Now that Puppet 4 has opened up I think it's a good time to fix this, once and for all.   The problem has recently hit me in Types and Providers where trying to use Boolean parameters and properties is just impossible because the RAL in a lot of places checks for truthiness ins...















 This message was sent by Atlassian JIRA (v6.1.4#6159-sha1:44eaede)




 








 

Jira (PUP-2371) Truthiness and nullness

2014-04-29 Thread Henrik Lindberg (JIRA)
Title: Message Title










 

 Henrik Lindberg commented on an issue


















  Re: Truthiness and nullness 










uh, yeah.. well... newvalues(true, false) defines an Enum of two symbols, could just as well have been newvalues(:red, :green). Here we would want to define that the value should be a Boolean. Not sure if you can do that. I guess it gets really difficult when also facing booleans in string form.
Because of this mess we think the best approach is to write a new catalog/type system with clearly defined rules, and then deal with backwards compatibility separately (at the border). Trying to fix the current under-specified mess is probably just going to cause a lot of grief. 












   

 Add Comment

























 Puppet /  PUP-2371



  Truthiness and nullness 







 Puppet's definition of what is truly True, False or Nil is completely insane. Now that Puppet 4 has opened up I think it's a good time to fix this, once and for all.   The problem has recently hit me in Types and Providers where trying to use Boolean parameters and properties is just impossible because the RAL in a lot of places checks for truthiness ins...















 This message was sent by Atlassian JIRA (v6.1.4#6159-sha1:44eaede)




 









  

Jira (PUP-2371) Truthiness and nullness

2014-04-29 Thread Daniele Sluijters (JIRA)
Title: Message Title










 

 Daniele Sluijters commented on an issue


















  Re: Truthiness and nullness 










The typical way to make them true (hah) booleans is to use either of require 'puppet/property/boolean' or require 'puppet/paramter/boolean' and add a , boolean = true, parent = Puppet::Parameter::Boolean to it. 
Unfortunately because of PUP-2368 (and I'm guessing in a few other places too) that only works when setting the property to 'true', never to 'false'.












   

 Add Comment

























 Puppet /  PUP-2371



  Truthiness and nullness 







 Puppet's definition of what is truly True, False or Nil is completely insane. Now that Puppet 4 has opened up I think it's a good time to fix this, once and for all.   The problem has recently hit me in Types and Providers where trying to use Boolean parameters and properties is just impossible because the RAL in a lot of places checks for truthiness ins...















 This message was sent by Atlassian JIRA (v6.1.4#6159-sha1:44eaede)




 














-- 
You received this message because you are subscribed to the Google Groups Puppet Bugs group.
To unsubscribe from this group and stop receiving emails from it, send an email to 

Jira (PUP-2371) Truthiness and nullness

2014-04-29 Thread Henrik Lindberg (JIRA)
Title: Message Title










 

 Henrik Lindberg commented on an issue


















  Re: Truthiness and nullness 










Seems like the best cause of action is to fix PUP-2368 while we are working on the new stuff.












   

 Add Comment

























 Puppet /  PUP-2371



  Truthiness and nullness 







 Puppet's definition of what is truly True, False or Nil is completely insane. Now that Puppet 4 has opened up I think it's a good time to fix this, once and for all.   The problem has recently hit me in Types and Providers where trying to use Boolean parameters and properties is just impossible because the RAL in a lot of places checks for truthiness ins...















 This message was sent by Atlassian JIRA (v6.1.4#6159-sha1:44eaede)




 














-- 
You received this message because you are subscribed to the Google Groups Puppet Bugs group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-bugs@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-2371) Truthiness and nullness

2014-04-29 Thread Daniele Sluijters (JIRA)
Title: Message Title










 

 Daniele Sluijters commented on an issue


















  Re: Truthiness and nullness 










Yes. Unfortunately it's a one-line fix which causes a lot of spec failures and I haven't had the courage yet to look at it. I believe Adrien Thebo wanted to go for it.












   

 Add Comment

























 Puppet /  PUP-2371



  Truthiness and nullness 







 Puppet's definition of what is truly True, False or Nil is completely insane. Now that Puppet 4 has opened up I think it's a good time to fix this, once and for all.   The problem has recently hit me in Types and Providers where trying to use Boolean parameters and properties is just impossible because the RAL in a lot of places checks for truthiness ins...















 This message was sent by Atlassian JIRA (v6.1.4#6159-sha1:44eaede)




 














-- 
You received this message because you are subscribed to the Google Groups Puppet Bugs group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-bugs@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-2371) Truthiness and nullness

2014-04-29 Thread JIRA
Title: Message Title










 

 Igor Galić commented on an issue


















  Re: Truthiness and nullness 










aaah. That's why I see so much type/provider code munging booleans.












   

 Add Comment

























 Puppet /  PUP-2371



  Truthiness and nullness 







 Puppet's definition of what is truly True, False or Nil is completely insane. Now that Puppet 4 has opened up I think it's a good time to fix this, once and for all.   The problem has recently hit me in Types and Providers where trying to use Boolean parameters and properties is just impossible because the RAL in a lot of places checks for truthiness ins...















 This message was sent by Atlassian JIRA (v6.1.4#6159-sha1:44eaede)




 














-- 
You received this message because you are subscribed to the Google Groups Puppet Bugs group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-bugs@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-2371) Truthiness and nullness

2014-04-29 Thread Charlie Sharpsteen (JIRA)
Title: Message Title










 

 Charlie Sharpsteen commented on an issue


















  Re: Truthiness and nullness 










Linked in PUP-1967 which is an older issue that PUP-2368 duplicates. The root cause of failure in defaultto false is that Puppet checks the hash of defaults for truthiness where the design of the code is assuming a check for nil (no default defined). Thus a default value of false gets treated the same as nil (no default).












   

 Add Comment

























 Puppet /  PUP-2371



  Truthiness and nullness 







 Puppet's definition of what is truly True, False or Nil is completely insane. Now that Puppet 4 has opened up I think it's a good time to fix this, once and for all.   The problem has recently hit me in Types and Providers where trying to use Boolean parameters and properties is just impossible because the RAL in a lot of places checks for truthiness ins...















 This message was sent by Atlassian JIRA (v6.1.4#6159-sha1:44eaede)




 














-- 
You received this message because you are subscribed to the Google Groups Puppet Bugs group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com.
To post to this group, send email to 

Jira (PUP-2371) Truthiness and nullness

2014-04-29 Thread Charlie Sharpsteen (JIRA)
Title: Message Title










 

 Charlie Sharpsteen commented on an issue


















  Re: Truthiness and nullness 










Ah. PUP-2368 is indeed a separate issue, but the cause is very similar to PUP-1967.












   

 Add Comment

























 Puppet /  PUP-2371



  Truthiness and nullness 







 Puppet's definition of what is truly True, False or Nil is completely insane. Now that Puppet 4 has opened up I think it's a good time to fix this, once and for all.   The problem has recently hit me in Types and Providers where trying to use Boolean parameters and properties is just impossible because the RAL in a lot of places checks for truthiness ins...















 This message was sent by Atlassian JIRA (v6.1.4#6159-sha1:44eaede)




 














-- 
You received this message because you are subscribed to the Google Groups Puppet Bugs group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-bugs@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-2371) Truthiness and nullness

2014-04-27 Thread Daniele Sluijters (JIRA)
Title: Message Title










 

 Daniele Sluijters created an issue


















 Puppet /  PUP-2371



  Truthiness and nullness 










Issue Type:

  Improvement




Affects Versions:


 3.5.1




Assignee:


 Unassigned




Created:


 27/Apr/14 7:02 AM




Fix Versions:


 4.x




Priority:

  Normal




Reporter:

 Daniele Sluijters










Puppet's definition of what is truly True, False or Nil is completely insane. Now that Puppet 4 has opened up I think it's a good time to fix this, once and for all.
The problem has recently hit me in Types and Providers where trying to use Boolean parameters and properties is just impossible because the RAL in a lot of places checks for truthiness instead of nullness.
I'm sure there's other examples both in Puppet's internals, Types and Providers and the DSL itself. I believe most of the DSL issues are fixed with future parser though.












   

   

Jira (PUP-2371) Truthiness and nullness

2014-04-27 Thread Daniele Sluijters (JIRA)
Title: Message Title










 

 Daniele Sluijters updated an issue


















 Puppet /  PUP-2371



  Truthiness and nullness 










Change By:

 Daniele Sluijters




Fix Version/s:

 4.x












   

 Add Comment






















 This message was sent by Atlassian JIRA (v6.1.4#6159-sha1:44eaede)




 














-- 
You received this message because you are subscribed to the Google Groups Puppet Bugs group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-bugs@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-2371) Truthiness and nullness

2014-04-27 Thread Henrik Lindberg (JIRA)
Title: Message Title










 

 Henrik Lindberg updated an issue


















 Puppet /  PUP-2371



  Truthiness and nullness 










Change By:

 Henrik Lindberg




Component/s:

 DSL












   

 Add Comment






















 This message was sent by Atlassian JIRA (v6.1.4#6159-sha1:44eaede)




 














-- 
You received this message because you are subscribed to the Google Groups Puppet Bugs group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-bugs@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-2371) Truthiness and nullness

2014-04-27 Thread Henrik Lindberg (JIRA)
Title: Message Title










 

 Henrik Lindberg updated an issue


















 Puppet /  PUP-2371



  Truthiness and nullness 










Change By:

 Henrik Lindberg




Labels:

 future-parser












   

 Add Comment






















 This message was sent by Atlassian JIRA (v6.1.4#6159-sha1:44eaede)




 














-- 
You received this message because you are subscribed to the Google Groups Puppet Bugs group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-bugs@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-2371) Truthiness and nullness

2014-04-27 Thread Henrik Lindberg (JIRA)
Title: Message Title










 

 Henrik Lindberg commented on an issue


















  Re: Truthiness and nullness 










This is a very thorny and multi faceted issue since the concept of no value is both poorly specified, and poorly implemented. In fact, the system uses different ways to handle no value in different parts of the system. How the fixes are made has backwards compatibility issues as well.


The 3x function API is designed so that undefined input is encoded as empty string


The 3x evaluator (and currently future evaluator as well) treats empty string and undefined as being equal to undef.


There is no requirement that values returned from functions are transformed back to Puppet (i.e. it may leak nil, :undef) or it may translate them to empty strings


When one function calls another there is no transformation - and Ruby values leak.


In 3x evaluation of argument expressions feed the Ruby result directly to the function




For 4x the consensus seems to be that the special  == undef should be removed.


In addition to this, the new function API should operate on Ruby types as it is expensive to transform (it already does this, but we have not yet focused on the particular nil vs. :undef issue)


Until we have a new catalog and a new way to handle resources and types it is very difficult to do anything about the existing RAL.














   

 Add Comment