{"action":"created","issue":{"url":"https://api.github.com/repos/chef-cookbooks/firewall/issues/187","repository_url":"https://api.github.com/repos/chef-cookbooks/firewall","labels_url":"https://api.github.com/repos/chef-cookbooks/firewall/issues/187/labels{/name}","comments_url":"https://api.github.com/repos/chef-cookbooks/firewall/issues/187/comments","events_url":"https://api.github.com/repos/chef-cookbooks/firewall/issues/187/events","html_url":"https://github.com/chef-cookbooks/firewall/issues/187","id":294529957,"number":187,"title":"chef-shell fails on firewall resources  ","user":{"login":"kam1kaze","id":2952868,"avatar_url":"https://avatars1.githubusercontent.com/u/2952868?v=4","gravatar_id":"","url":"https://api.github.com/users/kam1kaze","html_url":"https://github.com/kam1kaze","followers_url":"https://api.github.com/users/kam1kaze/followers","following_url":"https://api.github.com/users/kam1kaze/following{/other_user}","gists_url":"https://api.github.com/users/kam1kaze/gists{/gist_id}","starred_url":"https://api.github.com/users/kam1kaze/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kam1kaze/subscriptions","organizations_url":"https://api.github.com/users/kam1kaze/orgs","repos_url":"https://api.github.com/users/kam1kaze/repos","events_url":"https://api.github.com/users/kam1kaze/events{/privacy}","received_events_url":"https://api.github.com/users/kam1kaze/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-05T20:23:11Z","updated_at":"2018-02-06T14:29:15Z","closed_at":null,"author_association":"NONE","body":"### Cookbook version\r\n2.6.3\r\n\r\n### Chef-client version\r\n13.7.16\r\n\r\n### Platform Details\r\nCentOS 7\r\n\r\n### Scenario:\r\nI wanna run my run_list using `chef-shell -z` to debug the code.\r\n\r\n### Steps to Reproduce:\r\nAdd recipe 'firewall::default' to run_list and execute `run_chef` in `chef-shell -z`\r\n\r\n### Expected Result:\r\nsuccessfully executed\r\n\r\n### Actual Result:\r\nGetting track-back\r\n```\r\n================================================================================\r\nError executing action `create` on resource 'firewall_rule[established]'\r\n================================================================================\r\n\r\nNoMethodError\r\n-------------\r\nundefined method `resource_collection' for nil:NilClass\r\n\r\nCookbook Trace:\r\n---------------\r\n/var/chef/cache/cookbooks/firewall/libraries/provider_firewall_rule.rb:27:in `action_create'\r\n```\r\n\r\nFull log has been attached:\r\n[chef.log](https://github.com/chef-cookbooks/firewall/files/1696621/chef.log)\r\n\r\nThe issue could be fixed by changing how we access run_context, `Chef.run_context.resource_collection` to `Chef.node.run_context.resource_collection` in all resources. But I'm not sure if it's right?"},"comment":{"url":"https://api.github.com/repos/chef-cookbooks/firewall/issues/comments/363438584","html_url":"https://github.com/chef-cookbooks/firewall/issues/187#issuecomment-363438584","issue_url":"https://api.github.com/repos/chef-cookbooks/firewall/issues/187","id":363438584,"user":{"login":"martinb3","id":103033,"avatar_url":"https://avatars0.githubusercontent.com/u/103033?v=4","gravatar_id":"","url":"https://api.github.com/users/martinb3","html_url":"https://github.com/martinb3","followers_url":"https://api.github.com/users/martinb3/followers","following_url":"https://api.github.com/users/martinb3/following{/other_user}","gists_url":"https://api.github.com/users/martinb3/gists{/gist_id}","starred_url":"https://api.github.com/users/martinb3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martinb3/subscriptions","organizations_url":"https://api.github.com/users/martinb3/orgs","repos_url":"https://api.github.com/users/martinb3/repos","events_url":"https://api.github.com/users/martinb3/events{/privacy}","received_events_url":"https://api.github.com/users/martinb3/received_events","type":"User","site_admin":false},"created_at":"2018-02-06T14:29:14Z","updated_at":"2018-02-06T14:29:14Z","author_association":"COLLABORATOR","body":"Hey there -- I actually asked around when I decided on `Chef.run_context`; supposedly that's the standard interface. It's possible Chef Shell is just going to be incompatible with an accumulator pattern cookbook (where multiple resources matter); I'd welcome input from Chef developers on the right way to do this, but I'm not sure switching to `Chef.node` is it (it'll break other use cases, IIRC)."}}
{"actor":{"display_login":"martinb3"}}