On Thu, Jun 23, 2011 at 3:33 PM, Carl Caum <c...@puppetlabs.com> wrote:

> I'm working on a provider and noticed my getter method for parameters can't
> pass back a hash or embedded array. I need the user to pass in a hash for a
> parameter.  If the getter method can't return a hash, I don't see how I can
> see if the property is in sync.
>
> This gist shows an example: https://gist.github.com/1043779
>
> <https://gist.github.com/1043779>Here's the return of 'ralsh sampletype':
>
> sampletype { 'bar':
>   ensure     => 'present',
>   hash_param => 'param1value1param2value2',
> }
> sampletype { 'foo':
>   ensure     => 'present',
>   hash_param => 'param1value1param2value2',
> }
>
>
> Is this a bug?
>

This just looks like a rendering bug in Puppet. This looks like the output
returned when calling to_s on a hash.
I spent a few minutes digging and came up with

Puppet::Resource#to_manifest

in 2.7.0 its around line: 267

267       if v.is_a? Array
268         "  %-#{attr_max}s => %s,\n" % [ k, "[\'#{v.join("', '")}\']" ]
269       else
270         "  %-#{attr_max}s => %s,\n" % [ k, "\'#{v}\'" ]
271       end

There probably needs to be some code that says how to correctly output a
hash




> - Carl
> (615) 653-0887
>
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to puppet-dev@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-dev+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to