Issue #19459 has been reported by Bruno Leon.
----------------------------------------
Feature #19459: create_resources() should accept hash keys with no parameters
https://projects.puppetlabs.com/issues/19459
Author: Bruno Leon
Status: Unreviewed
Priority: Normal
Assignee:
Category:
Target version:
Affected Puppet version:
Keywords: create_resources
hash
Branch:
When using create_resources(), you must pass a hash as the first parameter,
each key being the title of one resource of the given type (passed as first
arg).
A key with an empty hash as its parameters translates as such in Puppet DSL:
create_resources( file, {'/tmp/foo' => {}} )
When using hiera, you would have something like:
create_resources( file, hiera('myfiles') )
And the yaml:
---
myfiles:
'foo':
This however will not be interpreted as an empty hash but rather as nil, which
in turns fail when the merge() function expects a hash:
Error: Could not retrieve catalog from remote server: Error 400 on SERVER:
can't convert nil into Hash
In the specific case of create_resources(), I think that this kind of yaml
should be acceptable (otherwise you will have to pass an empty argument just
for a syntaxic issue).
I did a simple patch that addresses this issue and allow a better usage of the
create_resources() function.
--
You have received this notification because you have either subscribed to it,
or are involved in it.
To change your notification preferences, please click here:
http://projects.puppetlabs.com/my/account
--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-bugs?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.