Given a site.pp that looks like this:

define test_type (
  $value = [],
) {
  $type = inline_template('<%= @value.class %>')
  notify { "${title} => ${type}": }
}

@@test_type { $::fqdn:
  value => [ $::fqdn ],
}

Test_type <<||>>

I get the odd result when run on icinga:

Notice: icinga.angel.net => Array
Notice: puppet.angel.net => String

Seemingly when my type is collected from puppetdb, somewhere in the chain 
an implicit type cast occurs.  It only seems to occur with arrays 
containing a single element.

Kind of annoying in that I can't put type validation in the defined type 
and have to 'Array(@value)' in templates.  Can't seem to find any mention 
of this behaviour, any pointers?

-- 
DataCentred Limited registered in England and Wales no. 05611763

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/993fa42e-264b-4123-9381-a3b7c1b21a12%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to