chef-cookbooks / iptables

Development repository for Chef Cookbook iptables
https://supermarket.chef.io/cookbooks/iptables
Apache License 2.0
102 stars 141 forks source link

Error: undefined method `validate' in rule.rb #56

Closed benthorner closed 8 years ago

benthorner commented 8 years ago

Cookbook version

2.2.0

Chef-client version

12.7+

Platform Details

RHEL

Scenario:

In Chef 13 this will become an error.

Steps to Reproduce:

 # recipes/*.rb
 iptables_rule 'redis' do
   source 'config/iptables.erb'
   variables(nodes: nodes)
 end

 # templates/*.erb
 -A INPUT -s 127.0.0.1 -j ACCEPT -p tcp --dport 6379

Expected Result:

- /var/chef/cache/cookbooks/iptables/resources/rule.rb:22:in `class_from_file'
 Default value {} is invalid for property #<ChefCompat::CopiedFromChef::Chef::Property:0x0000000573ed08>. In Chef 13 this will become an error: undefined method `validate' for nil:NilClass. at 1 location:
 - /var/chef/cache/cookbooks/iptables/resources/rule.rb:23:in `class_from_file'

Actual Result:

- /var/chef/cache/cookbooks/iptables/resources/rule.rb:22:in `class_from_file'
 Default value {} is invalid for property #<ChefCompat::CopiedFromChef::Chef::Property:0x0000000573ed08>. In Chef 13 this will become an error: undefined method `validate' for nil:NilClass. at 1 location:
 - /var/chef/cache/cookbooks/iptables/resources/rule.rb:23:in `class_from_file'
lamont-granquist commented 8 years ago

that was either an old bug in the cookbook, an old bug in chef-client or an old bug in the compat_resources cookbook, either way i can't replicate it now.