diff options
author | John Keiser <john@johnkeiser.com> | 2015-06-01 13:20:27 -0700 |
---|---|---|
committer | John Keiser <john@johnkeiser.com> | 2015-06-01 13:21:22 -0700 |
commit | 33df30d0f8c75b1e600da2f169fee0f8e58f694a (patch) | |
tree | 486e4d616f2f4b2d1d605ffeb96e0eec6c97f7b5 /DOC_CHANGES.md | |
parent | ac9c7c7f4bb7752c14f06224cdd1157d494dc02f (diff) | |
download | chef-33df30d0f8c75b1e600da2f169fee0f8e58f694a.tar.gz |
Doc updatesjk/resource_action_attributes
Diffstat (limited to 'DOC_CHANGES.md')
-rw-r--r-- | DOC_CHANGES.md | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/DOC_CHANGES.md b/DOC_CHANGES.md index feea3414e8..cba06a26e6 100644 --- a/DOC_CHANGES.md +++ b/DOC_CHANGES.md @@ -28,6 +28,19 @@ Authors of HWRPs need to be aware that in the future all resources and providers Users are encouraged to declare resources in their own namespaces instead of putting them in the special `Chef::Resource` namespace. +### Resources may now use `allowed_actions` and `default_action` + +Instead of overriding `Chef::Resource.initialize` and setting `@allowed_actions` and `@action` in the constructor, you may now use the `allowed_actions` and `default_action` DSL to declare them: + +```ruby +class MyResource < Chef::Resource + use_automatic_resource_name + + allowed_actions :create, :delete + default_action :create +end +``` + ### LWRPs are no longer automatically placed in the `Chef::Resource` namespace Starting with Chef 12.4.0, accessing an LWRP class by name from the `Chef::Resource` namespace will trigger a deprecation warning message. This means that if your cookbook includes the LWRP `mycookbook/resources/myresource.rb`, you will no longer be able to extend or reference `Chef::Resource::MycookbookMyresource` in Ruby code. LWRP recipe DSL does not change: the LWRP will still be available to recipes as `mycookbook_myresource`. |