| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
|
|
|
|
|
|
|
|
|
|
| |
only set it if the resource doesn't set one.
this means that we don't call resource_name or provides before parsing
the file so that the chef_version_for_provides API in #7524 can work
(otherwise we throw the deprecation warning before we ever parse the
file).
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
|
|
|
| |
Signed-off-by: Thom May <thom@chef.io>
|
|
|
|
| |
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
|
|
|
| |
Signed-off-by: Noah Kantrowitz <noah@coderanger.net>
|
|
|
| |
Generated via git ls-files | xargs perl -pi -e "s/[Cc]opyright (?:\([Cc]\) )?((?\!$(date +%Y))\\d{4})(-\\d{4})?([, ][ \d]+)*(,|(?= ))/Copyright \\1-$(date +%Y),/g"
|
|
|
|
|
|
|
| |
This is an entirely mechanically generated (chefstyle -a) change, to go
along with chef/chefstyle#5 . We should pick something and use it
consistently, and my opinion is that double quotes are the appropriate
thing.
|
|
|
|
| |
tests for debug messages when reloading resources
|
| |
|
|
|
|
| |
If you showed up in a post-LWRP world these would be confusing
|
|
|
|
|
| |
This reverts commit 27d8675ec1c80f1eb7ec57f7b6c854441bb395ee, reversing
changes made to 3501ba4020dc21377bc999e57e25eadb315ec783.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Repro
=====
The following cookbook would repro the issue
cookbooks/lwrptest/resources/my_lwrp.rb
---------------------------------------
```ruby
```
cookbooks/lwrptest/providers/my_lwrp.rb
---------------------------------------
```ruby
```
cookbooks/lwrptest/recipes/default.rb
-------------------------------------
```ruby
module Something
def something
puts 'something here'
end
end
::Chef::Resource::LwrptestMyLwrp.send(:include, Something)
lwrptest_my_lwrp 'blah' do
something
end
```
Why it does not work
====================
Running this in 12.4.0 produces the error
```
NoMethodError
-------------
undefined method `something' for LWRP resource lwrptest_my_lwrp from cookbook lwrptest
```
The problem is that LWRP usage through `Chef::Resource::MyLwrp` and
`Chef::Provider::MyLwrp` is depreacted. In order to participate in
the deprecation, `Chef::Resource::MyLwrp` is a subclass of the actual
`MyLwrp` class with `initialize` overriden to do a Chef::Log.deprecation.
In the example above, the intention is to add a method to the resource
so that it can be used from the dsl. The reason this does not work is
because including the method on `Chef::Resource::MyLwrp` adds the method
to the subclass, and the resource that is looked up when running the
recipe is the actual resource.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|\ |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
|/
|
|
|
| |
- Declare all resource DSL as methods on Chef::DSL::Resources
- Declare all definition DSL as methods on Chef::DSL::Definitions
|
|
|
|
|
|
|
|
| |
This reverts commit 2603e2153d6ab50179d2278025a51579edb9033f, reversing
changes made to a7f5c92960aedf8d5bfc71abbce430ab075e016a.
Conflicts:
CHANGELOG.md
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
introduced nillable_set_or_return so that we can actually set a nil value
on a resource from the DSL.
this fixes the case where you want to do (and we document) setting
symlink_before_migrate to nil on the deploy resource.
to implement this better also moved up the attribute DSL method to the
base Chef::Resource class.
all LWRP resources are now nillable as well.
|
|
|
|
|
|
|
|
| |
* providers had the same bug as CHEF-4117 on resources
* removed the strict_const_defined method on Chef::Resource since
ruby 1.8.7 deprecation made that method entirely trivial
* added tests, verified the failure cases really work
* todo added since i think we're leaking state in-between tests
|
|
|
|
| |
2 specific, issue #2497)
|
| |
|
| |
|
| |
|
|\
| |
| | |
Keep deprecation of valid_actions until Chef 13.
|
| |
| |
| |
| | |
This reverts commit 4aec038d42eae5c3c3bac50aa211d2b69cf54019.
|
| | |
|
|/ |
|
|
|
|
|
|
|
|
|
|
|
|
| |
if you specify a default_action we don't inherit from the superclass and
initialize to an empty array if we have to (otherwise if we inherited
from the superclass and later specified actions, we wouldn't get the
correct behavior which overrides the superclass, and behavior would
shift based on order of actions and default_action in the resource
definition).
also uses set union to eliminate dups in the (allowed) actions and
eliminates dups in both cases.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When inheriting from +Resource::LWRPBase+, the +default_action+ and +actions+
attributes are set as class instance variables. In Ruby's object model, class
instance variables are **not** shared with children. So subclassing a resource
that extended from +Resource::LWRPBase+ would result in some unexplainable
side-effects:
class Chef::Resource::Parent < Chef::Resource::LWRPBase
actions :execute
default_action :execute
end
class Child::Resource::Child < Chef::Resource::Parent
# In here, +actions+ and +default_action+ are **not** inherited so they
# are +nil+!
end
This commit tells resources that inherit from LWRPBase to check their
superclasses for values if they do not have one on their own.
This commit also deprecate +valid_actions+ in favor of just using +actions+ in
the LWRP DSL.
|
| |
|
|
|
|
|
|
|
|
|
| |
Previously this was marked as an internal API, but I am making it public. We
are reliably using this API in our LHWRPs in Release Engineering and it is
truly a delightful experience.
This deprecates using +resource_name = :foo+ in favor of the more "Chef-like"
+resource_name(:foo)+.
|