Jira (PUP-3992) yaml nulls break data binding for class params

2015-02-13 Thread Christopher Wood (JIRA)
Title: Message Title
 
 
 
 
 
 
 
 
 
 
  
 
 Christopher Wood commented on  PUP-3992 
 
 
 
 
 
 
 
 
 
 


 
 
 
 
 
 
  Re: yaml nulls break data binding for class params  
 
 
 
 
 
 
 
 
 
 
After jcbollinger's followup in that thread, I think the problem here is not that puppet is not accepting the null as undef from hiera, but that the error message seems a bit puzzling. 
Instead of 
Must pass param1 
perhaps something like 
Must pass a non-nil value for param1 
Because the hiera key is there, it's just that the value associated with the key is unacceptable. 
 
 
 
 
 
 
 
 
 
 
 
 

 
 Add Comment 
 
 
 
 
 
 
 
 
 
 


 
 
 
 
 
 
 
 
 

 This message was sent by Atlassian JIRA (v6.3.10#6340-sha1:7ea293a) 
 
 
 
 
  
 
 
 
 
 
 
 
 
   





-- 
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-3992) yaml nulls break data binding for class params

2015-02-13 Thread Henrik Lindberg (JIRA)
Title: Message Title
 
 
 
 
 
 
 
 
 
 
  
 
 Henrik Lindberg commented on  PUP-3992 
 
 
 
 
 
 
 
 
 
 


 
 
 
 
 
 
  Re: yaml nulls break data binding for class params  
 
 
 
 
 
 
 
 
 
 
Hiera signals not found by returning nil - with the current implementation it is not possible to differentiate between the two. You should however be able to return an array or hash with a nil value. 
I am changing the title of this ticket since it is a general hiera problem, not specific to YAML (albeit the fix may need to be made in all backends). 
 
 
 
 
 
 
 
 
 
 
 
 

 
 Add Comment 
 
 
 
 
 
 
 
 
 
 


 
 
 
 
 
 
 
 
 

 This message was sent by Atlassian JIRA (v6.3.10#6340-sha1:7ea293a) 
 
 
 
 
  
 
 
 
 
 
 
 
 
   





-- 
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-3992) yaml nulls break data binding for class params

2015-02-10 Thread Christopher Wood (JIRA)
Title: Message Title
 
 
 
 
 
 
 
 
 
 
  
 
 Christopher Wood commented on  PUP-3992 
 
 
 
 
 
 
 
 
 
 


 
 
 
 
 
 
  Re: yaml nulls break data binding for class params  
 
 
 
 
 
 
 
 
 
 
Linking to some things also dealing with true/false/nil, it appears to my uneducated eyes that similar issues have cropped up before. 
 
 
 
 
 
 
 
 
 
 
 
 

 
 Add Comment 
 
 
 
 
 
 
 
 
 
 


 
 
 
 
 
 
 
 
 

 This message was sent by Atlassian JIRA (v6.3.10#6340-sha1:7ea293a) 
 
 
 
 
  
 
 
 
 
 
 
 
 
   





-- 
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-3992) yaml nulls break data binding for class params

2015-02-10 Thread Christopher Wood (JIRA)
Title: Message Title
 
 
 
 
 
 
 
 
 
 
  
 
 Christopher Wood updated an issue 
 
 
 
 
 
 
 
 
 
 


 
 
 
 
 
 
 Puppet /  PUP-3992 
 
 
 
  yaml nulls break data binding for class params  
 
 
 
 
 
 
 
 
 

Change By:
 
 Christopher Wood 
 
 
 
 
 
 
 
 
 
 Assumingthisclass:classtesting::cwood1($param1){#stuff}Andhavingayamlnullinmyhieradata,orakeywithnovalue,likeeitherofthese:testing::cwood1::param1:nulltesting::cwood1::param1:~testing::cwood1::param1:Igeterrorsabouthowtheclassneedsaparameter.Feb1011:14:05puppetmaster2devpuppet-master[7546]:Mustpassparam1toClass[Testing::Cwood1]at/etc/puppet/environments/production/modules/testing/manifests/init.pp:3onnodept1.me.comWithanexplicitlyemptystringIdonotseethiserror,theclassparameterisaccepted.testing::cwood1::param1:''Theproblemisthattheclassdoesn'tpickuphowI'vedefinedthehierakeytesting::cwood1::param1.NeverthelessthekeyisthereandIampassingsomething,evenifIampassingarepresentationofnothing.Iexpectedthatthismighthavethesameresultasdoing$param1=undefsincetheundefthereistheclosestthinginpuppettorubynil,yamlnull.Thatsaid,thereareanumberofinterestingticketsabouttrue/truthy/false/nilhandlingandIwilllinkthoseheresinceit'sprobablyasubsetofthoseissues.Further,astraightcommand-linehieralookupappearstorepresenttheseasnil. a [root@puppetmaster2dev~]#greptesting::cwood1::param1/etc/puppet/environments/production/hieradata/nodes/pt1.me.com.eyamltesting::cwood1::param1:null[root@puppetmaster2dev~]#hieratesting::cwood1::param1environment=productionfqdn=pt1.me.comnil[root@puppetmaster2dev~]#greptesting::cwood1::param1/etc/puppet/environments/production/hieradata/nodes/pt1.me.com.eyamltesting::cwood1::param1:~[root@puppetmaster2dev~]#hieratesting::cwood1::param1environment=productionfqdn=pt1.me.comnilAquickyamlreadpickstheseupasnil,aswell.#!/usr/bin/envrubyrequire'pp'require'yaml'data=File.read(ARGV[0])yaml=YAML.load(data)ppyamlYAMLnulls:http://yaml.org/type/null.html 
 
 
 
 
 
 
 
 
 
 
 
 

 
 Add Comment 
 
 
 
 
 
 
 
 
 
 


 
 
 
 
 
 
 
 
 

 This message was sent by Atlassian JIRA (v6.3.10#6340-sha1:7ea293a) 
 
 
 
   

Jira (PUP-3992) yaml nulls break data binding for class params

2015-02-10 Thread Christopher Wood (JIRA)
Title: Message Title
 
 
 
 
 
 
 
 
 
 
  
 
 Christopher Wood created an issue 
 
 
 
 
 
 
 
 
 
 


 
 
 
 
 
 
 Puppet /  PUP-3992 
 
 
 
  yaml nulls break data binding for class params  
 
 
 
 
 
 
 
 
 

Issue Type:
 
  Bug 
 
 
 

Affects Versions:
 

 PUP 3.7.2 
 
 
 

Assignee:
 

 Unassigned 
 
 
 

Created:
 

 2015/02/10 8:39 AM 
 
 
 

Environment:
 
 
puppetmaster runs on: 
[root@puppetmaster2dev ~]# cat /etc/redhat-release  CentOS release 6.2 (Final) [root@puppetmaster2dev ~]# rpm -qa | egrep '^(puppet|hiera)' puppet-3.7.2-1.el6.noarch hiera-eyaml-1.3.4-1.el6.re.noarch hiera-1.3.4-1.el6.noarch puppetdb-terminus-2.2.2-1.el6.noarch 
 
 
 

Priority:
 
  Normal 
 
 
 

Reporter:
 
 Christopher Wood 
 
 
 
 
 
 
 
 
 
 
Assuming this class: 
class testing::cwood1 ( $param1 )  { # stuff } 
And having a yaml null in my hieradata, or a key with no value, like either of these: 
testing::cwood1::param1: null testing::cwood1::param1: ~ testing::cwood1::param1: 
I get errors about how the class needs a parameter. 
Feb 10 11:14:05 puppetmaster2dev puppet-master[7546]: Must pass param1 to Class[Testing::Cwood1] at /etc/puppet/environments/production/modules/testing/manifests/init.pp:3 on node pt1.me.com 
With an 

Jira (PUP-3992) yaml nulls break data binding for class params

2015-02-10 Thread Christopher Wood (JIRA)
Title: Message Title
 
 
 
 
 
 
 
 
 
 
  
 
 Christopher Wood commented on  PUP-3992 
 
 
 
 
 
 
 
 
 
 


 
 
 
 
 
 
  Re: yaml nulls break data binding for class params  
 
 
 
 
 
 
 
 
 
 
Related thread: 
https://groups.google.com/forum/#!topic/puppet-users/0l3m4VCHjOg 
 
 
 
 
 
 
 
 
 
 
 
 

 
 Add Comment 
 
 
 
 
 
 
 
 
 
 


 
 
 
 
 
 
 
 
 

 This message was sent by Atlassian JIRA (v6.3.10#6340-sha1:7ea293a) 
 
 
 
 
  
 
 
 
 
 
 
 
 
   





-- 
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.