- From: AJ Christensen <
>
- To: "
" <
>
- Subject: [chef] Re: custom lwrp
- Date: Wed, 24 Dec 2014 09:18:39 +1300
It should be
(@new_resource.tags)`
hth,
--aj
On Wed, Dec 24, 2014 at 9:14 AM, Ameya Savale
<
>
wrote:
>
Hi I've been having a bit of trouble creating my custom lwrp
>
>
I have declared a custom resource, but the issue I'm having is setting
>
values for attributes that I declare for the resource. Here is my resource:
>
>
actions :add
>
default_action :add
>
>
attribute :username, :name_attribute => true, :kind_of => String, :required
>
=> true
>
attribute :password, :kind_of => String
>
attribute :tags, :kind_of => String
>
>
state_attrs :username,
>
:tags
>
>
attr_accessor :exists
>
>
so when i try to access the tags attribute of the resource in my provider I
>
get the following error:
>
>
NoMethodError: undefined method `tags=' for Chef::Resource::RabbitmqUsers
>
>
@current_resource =
>
Chef::Resource::RabbitmqUsers.new(@new_resource.username)
>
@current_resource.tags = @new_resource.tags
>
>
Its on the second line that i hit the error, specifically on
>
@current_resource.tags, @new_resource.tags has the correct value when I
>
print it out. Not sure what I'm missing here.
>
>
- Thanks
>
Ameya
>
- [chef] custom lwrp, Ameya Savale, 12/23/2014
- [chef] Re: custom lwrp, AJ Christensen, 12/23/2014
Archive powered by MHonArc 2.6.16.