No resource or method named `with_run_context' for `LWRP resource iptables_rule from cookbook iptables action provider
orarnon opened this issue · comments
Cookbook version
~> 4.0.0
Chef-client version
Chef: 12.5.1
Platform Details
Ubuntu 12
Scenario:
Running Chef and encounter:
* iptables_rule[cassandra] action enable
================================================================================
Error executing action `enable` on resource 'iptables_rule[cassandra]'
================================================================================
NoMethodError
-------------
No resource or method named `with_run_context' for `LWRP resource iptables_rule from cookbook iptables action provider "cassandra"'
Cookbook Trace:
---------------
/var/chef/cache/cookbooks/iptables/resources/rule.rb:28:in `block in class_from_file'
/var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:78:in `run_action'
/var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:106:in `block (2 levels) in converge'
/var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:106:in `each'
/var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:106:in `block in converge'
/var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:105:in `converge'
Resource Declaration:
---------------------
# In /var/chef/cache/cookbooks/sonic-phpapp/recipes/iptables.rb
1: iptables_rule 'cassandra' do
2: action :enable
3: end
Compiled Resource:
------------------
# Declared in /var/chef/cache/cookbooks/sonic-phpapp/recipes/iptables.rb:1:in `from_file'
iptables_rule("cassandra") do
action [:enable]
retries 0
retry_delay 2
default_guard_interpreter :default
declared_type :iptables_rule
cookbook_name "sonic-phpapp"
recipe_name "iptables"
end
Thanks for reporting this issue. With the rewrite of the rule resource with this commit, 136cfb2 in order to make sure that rebuild-iptables only runs once this cookbook requires Chef 12.10+. https://docs.chef.io/release_notes.html#with-run-context for more information.
The metadata and README has been updated to reflect the Chef 12.10 requirement. Thanks again for reporting.