sous-chefs / aws

Development repository for the aws cookbook
https://supermarket.chef.io/cookbooks/aws
Apache License 2.0
610 stars 554 forks source link

Platform_family? used in custom resource throws method missing #393

Closed MarkGibbons closed 5 years ago

MarkGibbons commented 5 years ago

Cookbook version

4.1.3

Chef-client version

15

Platform Details

Linux

Scenario:

Using the aws_s3_files resource throws a method missing for the use of platfom_family? when defining properties.

Steps to Reproduce:

Any use of aws_s3_file resource. _aws_s3files 'filename'

Expected Result:

Use a file.

Actual Result:

================================================================================ Recipe Compile Error in /tmp/kitchen/cache/cookbooks/testbook/resources/test1.rb

   NoMethodError
   -------------
   undefined method `platform_family?' for #<Class:0x00000000045cf798>

   Cookbook Trace:
   ---------------
     /tmp/kitchen/cache/cookbooks/testbook/resources/test1.rb:2:in `class_from_file'

   Relevant File Content:
   ----------------------
   /tmp/kitchen/cache/cookbooks/testbook/resources/test1.rb:

     1:     property :content, String
     2>> if platform_family?('rhel')
     3:     property :path, String, name_property: true
     4:  end
     5:
     6:  # Block arguments
     7:  # desired_state: false
     8:  # identity: true
     9:  # name_property: true
welcomebot commented 5 years ago

Hey There It looks like this is the first issue you've filed against the chef-cookbooks project. I'm here to offer you a bit of extra help to make sure we can quickly get back to you. Make sure you've filled out all the fields in our issue template. Make sure you've provided us with the version of chef-client you're running, your operating system and the version of the cookbook. If you're not using the most up to date version of the cookbook then please make sure to update first. Lots of things change between versions even if you're issue isn't listed in the changelog. Finally please give us a detailed description of the issue you're having. The more we know about what you're trying to do, what actually happens, and how you can reproduce the problem, the better.

If you're looking for more immediate troubleshooting help make sure to check out #general on the Chef Community Slack. There's plenty of folks there willing to lend a helping hand. Thanks for the first issue. We hope we can get back to you soon with a solution.

majormoses commented 5 years ago

This should be fixed as part of https://github.com/chef-cookbooks/aws/pull/397 and https://github.com/chef-cookbooks/aws/blob/v8.1.1/CHANGELOG.md#811-2019-11-10 if you upgrade to the latest version and it is not fixed we can re-open.