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

Version 2.2.0 undefined method `property' for Chef::Resource::IptablesRule:Class #49

Closed NaN1488 closed 8 years ago

NaN1488 commented 8 years ago

I fixed the issue changing version to 1.0.0

Compiling Cookbooks...

================================================================================
Recipe Compile Error in .../chef-solo/cookbooks-2/iptables/resources/rule.rb
================================================================================

NoMethodError
-------------
undefined method `property' for Chef::Resource::IptablesRule:Class

Cookbook Trace:
---------------
 .../chef-solo/cookbooks-2/iptables/resources/rule.rb:20:in `class_from_file'

Relevant File Content:
----------------------
.../chef-solo/cookbooks-2/iptables/resources/rule.rb:

 13:  #
 14:  # Unless required by applicable law or agreed to in writing, software
 15:  # distributed under the License is distributed on an "AS IS" BASIS,
 16:  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 17:  # See the License for the specific language governing permissions and
 18:  # limitations under the License.
 19:
 20>> property :name, kind_of: String, name_attribute: true
 21:  property :source, kind_of: String, default: nil
 22:  property :cookbook, kind_of: String, default: nil
 23:  property :variables, kind_of: Hash, default: {}
 24:
 25:  action :enable do
 26:    execute 'rebuild-iptables' do
 27:      command '/usr/sbin/rebuild-iptables'
 28:      action :nothing
 29:    end
tas50 commented 8 years ago

This occurs if you're running chef-client prior to 12.5. 12.5 introduced a new, simpler, method of creating custom resources and this cookbook uses the new method.

NaN1488 commented 8 years ago

@tas50 thanks!