Issue #4433 has been updated by Aaron Grewell.
FYI, I found an interesting issue a few minutes ago when using the attached
ymllookup program: when I imported an array of hashes they only worked as
resource names as long as none of the values started with a number. As soon as
the value assigned to any key started with a number it would fail with a pson
error. I realize this is unsupported code and I don't expect anyone to fix it,
but I thought I'd mention it in case it came up later or was a general Puppet
bug instead of a shortcoming in ymllookup.
Good YAML:
network_interfaces:
- interface: "bond0"
slaves: "eth0,eth1"
Bad YAML:
network_interfaces:
- interface: "bond0"
slaves: "eth0,eth1"
test: "5test5"
site.pp:
$network_interfaces = ymllookup("network_interfaces")
define create_net_interfaces () { }
create_net_interfaces { $network_interfaces: }
Error:
err: Could not retrieve catalog from remote server: Could not intern from pson:
Could not convert from pson: Could not find relationship target
"Network::Create_net_interfaces[test55test5interfacebond0slaveseth0,eth1]"
----------------------------------------
Feature #4433: Add hash support to extlookup
https://projects.puppetlabs.com/issues/4433
Author: R.I. Pienaar
Status: Needs Decision
Priority: Normal
Assignee: Nigel Kersten
Category: functions
Target version: 2.7.x
Affected Puppet version: 2.6.0
Keywords:
Branch: http://github.com/ripienaar/puppet/tree/extlookup_hash_support
I've added hash support to extlookup. Really it's time to add yaml support but
thats a whole different story.
CSV files can now have:
<pre>
test,key=val
another,key=val,foo=bar
</pre>
And it will return hashesh:
<pre>
{"key" => "val"}
{"key" => "val", "foo" => "bar"}
</pre>
In the event that not all values have a = in them it will just behave as old
and return arrays.
My concern here is that we have a small case of breaking backward compatibility
should someone already have key=val style values. We should make this clear in
the release notes.
--
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-bugs?hl=en.