- From: Adam Jacob <
- Subject: [chef] Re: Re: Re: Re: making a library global?
- Date: Tue, 20 Jul 2010 17:36:47 -0700
resource_name is used for lookup and stringification of resources:
@resource_name = :pylabs_qshell
Means you can do:
resources(:pylabs_qshell => "foo")
On Mon, Jul 19, 2010 at 8:52 AM, Daniel DeLeo
>> -- START --
>> require 'chef/resource/script'
>> class Chef
>> class Resource
>> class QShell < Chef::Resource::Script
>> def initialize(name, run_context=nil)
>> = :pylabs_qshell
>> = "/opt/qbase3/qshell -f"
>> -- END --
>> All required files are in my client cache, but still I get a
>> NoMethodError on "pylabs_qshell", which is the @resource_name.
>> 2010-07-19_09:41:42.73142 [Mon, 19 Jul 2010 11:41:42 +0200] ERROR:
>> 2010-07-19_09:41:42.73143 [Mon, 19 Jul 2010 11:41:42 +0200] FATAL:
>> undefined method `pylabs_qshell' for #<Chef::Recipe:0x7fc7e53f9aa8>
>> /srv/chef/cache/cookbooks/dss/recipes/pylabs.rb:23:in `from_file'
>> What am I missing here?
> Resources are looked up by finding a constant defined on
> Chef::Resource matching the CamelCased name of the method you called,
> so calling pylabs_qshell causes chef to look for
> Chef::Resource::PylabsQshell. I'm not sure what the resource_name is
> used for, but it doesn't manipulate the way the method names map to
> resource classes.
> Dan DeLeo
Adam Jacob, CTO
T: (206) 508-7449 E:
Archive powered by MHonArc 2.6.16.