- From: Steven Danna <
>
- To:
- Subject: [chef] Re: RE: Deleting Node attributes using Knife
- Date: Sun, 06 Apr 2014 12:57:14 -0700
On 4/3/14, 1:41 PM, Kapil Shardha wrote:
>
>
>
The workaround I have been using is to use “knife node edit <NODENAME>”
>
and manually delete the attributes. This is acceptable to me for now but
>
would appreciate if I can get more insight on why the knife command
>
mentioned in original post does not work.
I'll have to dig in a bit to see where it broke, but it definitely looks
like the #delete method no longer works as documented on that page.
However, if you know the level you set the attribute at, you can still
delete it directly:
[1] pry(main)> require 'chef'
=> true
[2] pry(main)> n = Chef::Node.new
=> node[]
[2] pry(main)> n.default['foo'] = 'bar'
=> "bar"
[3] pry(main)> n['foo']
=> "bar"
[4] pry(main)> n.delete('foo')
=> nil
[5] pry(main)> n['foo']
=> "bar"
[6] pry(main)> n.default.delete('foo')
=> "bar"
[7] pry(main)> n['foo']
=> nil
My guess is that this changed with the new Chef 11 attribute work that
was done. But, even if it is intentional we should get
http://docs.opscode.com/breaking_changes_chef_11.html
and any other documentation that refers to it update.
Cheers,
Steven
--
Steven Danna
Systems Engineer, Chef, Inc
GPG Key:
https://stevendanna.github.com/downloads/code/public.key
Attachment:
signature.asc
Description: OpenPGP digital signature
Archive powered by MHonArc 2.6.16.