Title: Message Title
Andreas Ntaflos updated an issue
Puppet / PUP-7464
Warning when trying to JSON-serialise undef value ("hash will be converted to string")
Change By:
Andreas Ntaflos
A warning message like the following appears in Puppetserver's logs (line breaks added for readability):{code}2017-04-23 16:12:15,935 WARN [qtp2095795815-27357] [puppetserver] Puppet Resource 'Icinga2::Object::Host[dns01.prod.example.com]'contains a Hash value. It will be converted to the String '{"distro"=>"Ubuntu", "is_virtual"=>true, "manufacturer"=>"QEMU", "os"=>"Linux", "parent"=>:undef, "project"=>"dns", "fqdn"=>"dns01.prod.example.com", "service"=>"dns-cluster","stage"=>"prod", "virtual"=>"kvm","notification"=>{"mail"=>{"groups"=>["admins"]}, "sms"=>{"groups"=>["admins"]}}}'{code}The resource in question looks like this:{code}...if getvar('::virtualisation_host') { $_parent = $::virtualisation_host} else { $_parent = undef}...@@icinga2::object::host { $::fqdn: import => $_import, display_name => $::fqdn, address => $::fqdn, target => '/etc/icinga2/objects/hosts.conf', tag => $::stage, vars => {applications => $_applications,distro => $::operatingsystem,fqdn => $::fqdn,is_virtual => $::is_virtual,manufacturer => $::manufacturer,os => $::kernel,parent => $_parent,project => $::project,service => $_service,stage=> $::stage,virtual => $::virtual,notification => { mail => {groups => $mail_groups, }, sms => {groups => $sms_groups, },}, },}{code}In this case ` {{ $_parent ` }} (and therefore the ` {{ parent ` }} value in the ` {{ vars ` }} hash) is set to ` {{ undef ` }} explicitly. This seems to trip up something in Puppet related to JSON-serialisation.I'll update this ticket with some reproducible code in the coming days.
Add Comment
This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe)