Hi,
I have stupid situation that I may workaround but I think there is an
elegant way to deal with.
Still I need the community help.
In some class X I have:
$control = {
dev => {
id => 7,
name => 'GG'
},
prod => {
id => 1,
name => 'Info'
}
}
In some other class, which I apply to a node I have defined file from a
templete, where I want to use those values depending on the zone property.
<%
$zone = scope.lookupvar('y::_zone')
$c_data = scope.lookupvar('x::control[${zone}]')
-%>
The zone property is OK and equals to dev.
I can't access the $c_data as in looks like nil (undefined).
And I need to output something as:
ID=<%= $c_data['id'] %>
which fails with error Detail: undefined method `[]' for nil:NilClass
Can you give me a hint/help?
--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.