- From: Matthias Marschall <
>
- To:
- Subject: [chef] Re: NoMethodError - undefined method `[]' for nil:NilClass
- Date: Thu, 18 Jul 2013 08:30:20 +0200
Hi,
This error message happens if there is no node[:test] attribute set.
Does your node have your role in its run list or did you only add the
cookbook containing your recipe to it by accident?
Am 18.07.2013 um 03:23 schrieb David Montgomery
<
>:
>
I have the below in a chef recipie
>
>
server_type = node[:test][:server_type]
>
>
In a role I have the below:
>
>
default_attributes "test" => { "server_type" => 'Compute' }
>
>
yet I get the below error
>
>
35:
>
36>> server_type = node[:test][:server_type]
>
[2013-07-18T01:16:55+00:00] DEBUG: Re-raising exception: NoMethodError -
>
undefined method `[]' for nil:NilClass
>
>
How do I resolve?
>
Archive powered by MHonArc 2.6.16.