{"action":"created","comment":{"url":"https://api.github.com/repos/chr4-cookbooks/iptables-ng/pulls/comments/47094167","id":47094167,"diff_hunk":"@@ -35,18 +35,24 @@ class Chef::Resource::RubyBlock\n   action :nothing\n end\n \n-ruby_block 'restart_iptables' do\n-  block do\n-    class Chef::Resource::RubyBlock\n-      include Iptables::Manage\n-    end\n+modern_and_paranoid = node['iptables-ng']['safe_reload'] && Chef::VERSION.to_f >= 12.5\n \n-    if node['iptables-ng']['managed_service']\n+if modern_and_paranoid\n+  Chef.event_handler do\n+    on :converge_complete do\n       Array(node['iptables-ng']['enabled_ip_versions']).each do |ip_version|\n-        restart_service(ip_version)\n-      end\n+        Iptables::Manage.conditionally_restart(ip_version, run_context)\n+      end if node['iptables-ng']['managed_service']","path":"recipes/manage.rb","position":19,"original_position":19,"commit_id":"f8f979b99dd61dfb2b6288ef8d030b3354475708","original_commit_id":"f8f979b99dd61dfb2b6288ef8d030b3354475708","user":{"login":"chr4","id":4600363,"avatar_url":"https://avatars.githubusercontent.com/u/4600363?v=3","gravatar_id":"","url":"https://api.github.com/users/chr4","html_url":"https://github.com/chr4","followers_url":"https://api.github.com/users/chr4/followers","following_url":"https://api.github.com/users/chr4/following{/other_user}","gists_url":"https://api.github.com/users/chr4/gists{/gist_id}","starred_url":"https://api.github.com/users/chr4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chr4/subscriptions","organizations_url":"https://api.github.com/users/chr4/orgs","repos_url":"https://api.github.com/users/chr4/repos","events_url":"https://api.github.com/users/chr4/events{/privacy}","received_events_url":"https://api.github.com/users/chr4/received_events","type":"User","site_admin":false},"body":"This doesn't work, as `node` is not available when running the tests here.\r\n\r\n```\r\nNameError: undefined local variable or method `node' for #<#<Class:0x000000050b92f8>:0x000000050b91e0>\r\n/tmp/kitchen/cache/cookbooks/iptables-ng/recipes/manage.rb:45:in `block (2 levels) in from_file'\r\n/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/event_dispatch/dsl.rb:53:in `instance_exec'\r\n/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/event_dispatch/dsl.rb:53:in `block in on'\r\n/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/event_dispatch/dispatcher.rb:38:in `call'\r\n/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/event_dispatch/dispatcher.rb:38:in `block in call_subscribers'\r\n/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/event_dispatch/dispatcher.rb:29:in `each'\r\n/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/event_dispatch/dispatcher.rb:29:in `call_subscribers'\r\n(eval):2:in `converge_complete'\r\n/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/client.rb:654:in `block in converge'\r\n/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/client.rb:648:in `catch'\r\n/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/client.rb:648:in `converge'\r\n/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/client.rb:687:in `converge_and_save'\r\n/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/client.rb:269:in `run'\r\n/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/application.rb:270:in `block in fork_chef_client'\r\n/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/application.rb:258:in `fork'\r\n/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/application.rb:258:in `fork_chef_client'\r\n/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/application.rb:224:in `block in run_chef_client'\r\n/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/local_mode.rb:44:in `with_server_connectivity'\r\n/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/application.rb:212:in `run_chef_client'\r\n/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/application/client.rb:408:in `block in interval_run_chef_client'\r\n/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/application/client.rb:398:in `loop'\r\n/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/application/client.rb:398:in `interval_run_chef_client'\r\n/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/application/client.rb:388:in `run_application'\r\n/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/application.rb:60:in `run'\r\n/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/bin/chef-client:26:in `<top (required)>'\r\n/opt/chef/bin/chef-client:54:in `load'\r\n/opt/chef/bin/chef-client:54:in `<main>'\r\n```","created_at":"2015-12-09T14:12:28Z","updated_at":"2015-12-09T14:12:28Z","html_url":"https://github.com/chr4-cookbooks/iptables-ng/pull/56#discussion_r47094167","pull_request_url":"https://api.github.com/repos/chr4-cookbooks/iptables-ng/pulls/56","_links":{"self":{"href":"https://api.github.com/repos/chr4-cookbooks/iptables-ng/pulls/comments/47094167"},"html":{"href":"https://github.com/chr4-cookbooks/iptables-ng/pull/56#discussion_r47094167"},"pull_request":{"href":"https://api.github.com/repos/chr4-cookbooks/iptables-ng/pulls/56"}}},"pull_request":{"url":"https://api.github.com/repos/chr4-cookbooks/iptables-ng/pulls/56","id":52741662,"html_url":"https://github.com/chr4-cookbooks/iptables-ng/pull/56","diff_url":"https://github.com/chr4-cookbooks/iptables-ng/pull/56.diff","patch_url":"https://github.com/chr4-cookbooks/iptables-ng/pull/56.patch","issue_url":"https://api.github.com/repos/chr4-cookbooks/iptables-ng/issues/56","number":56,"state":"open","locked":false,"title":"🚧 Add optional \"safe-reload\" mode","user":{"login":"nathwill","id":371597,"avatar_url":"https://avatars.githubusercontent.com/u/371597?v=3","gravatar_id":"","url":"https://api.github.com/users/nathwill","html_url":"https://github.com/nathwill","followers_url":"https://api.github.com/users/nathwill/followers","following_url":"https://api.github.com/users/nathwill/following{/other_user}","gists_url":"https://api.github.com/users/nathwill/gists{/gist_id}","starred_url":"https://api.github.com/users/nathwill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nathwill/subscriptions","organizations_url":"https://api.github.com/users/nathwill/orgs","repos_url":"https://api.github.com/users/nathwill/repos","events_url":"https://api.github.com/users/nathwill/events{/privacy}","received_events_url":"https://api.github.com/users/nathwill/received_events","type":"User","site_admin":false},"body":"related to #34","created_at":"2015-12-05T01:14:23Z","updated_at":"2015-12-09T14:12:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dd9b5a152039d53218d73dee5eef537b54786f54","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/chr4-cookbooks/iptables-ng/pulls/56/commits","review_comments_url":"https://api.github.com/repos/chr4-cookbooks/iptables-ng/pulls/56/comments","review_comment_url":"https://api.github.com/repos/chr4-cookbooks/iptables-ng/pulls/comments{/number}","comments_url":"https://api.github.com/repos/chr4-cookbooks/iptables-ng/issues/56/comments","statuses_url":"https://api.github.com/repos/chr4-cookbooks/iptables-ng/statuses/f8f979b99dd61dfb2b6288ef8d030b3354475708","head":{"label":"nathwill:no-reloads-on-err","ref":"no-reloads-on-err","sha":"f8f979b99dd61dfb2b6288ef8d030b3354475708","user":{"login":"nathwill","id":371597,"avatar_url":"https://avatars.githubusercontent.com/u/371597?v=3","gravatar_id":"","url":"https://api.github.com/users/nathwill","html_url":"https://github.com/nathwill","followers_url":"https://api.github.com/users/nathwill/followers","following_url":"https://api.github.com/users/nathwill/following{/other_user}","gists_url":"https://api.github.com/users/nathwill/gists{/gist_id}","starred_url":"https://api.github.com/users/nathwill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nathwill/subscriptions","organizations_url":"https://api.github.com/users/nathwill/orgs","repos_url":"https://api.github.com/users/nathwill/repos","events_url":"https://api.github.com/users/nathwill/events{/privacy}","received_events_url":"https://api.github.com/users/nathwill/received_events","type":"User","site_admin":false},"repo":{"id":26136714,"name":"iptables-ng","full_name":"nathwill/iptables-ng","owner":{"login":"nathwill","id":371597,"avatar_url":"https://avatars.githubusercontent.com/u/371597?v=3","gravatar_id":"","url":"https://api.github.com/users/nathwill","html_url":"https://github.com/nathwill","followers_url":"https://api.github.com/users/nathwill/followers","following_url":"https://api.github.com/users/nathwill/following{/other_user}","gists_url":"https://api.github.com/users/nathwill/gists{/gist_id}","starred_url":"https://api.github.com/users/nathwill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nathwill/subscriptions","organizations_url":"https://api.github.com/users/nathwill/orgs","repos_url":"https://api.github.com/users/nathwill/repos","events_url":"https://api.github.com/users/nathwill/events{/privacy}","received_events_url":"https://api.github.com/users/nathwill/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nathwill/iptables-ng","description":"Cookbook to maintain iptables rules and policies on different platforms, respecting the way the os handles these settings.","fork":true,"url":"https://api.github.com/repos/nathwill/iptables-ng","forks_url":"https://api.github.com/repos/nathwill/iptables-ng/forks","keys_url":"https://api.github.com/repos/nathwill/iptables-ng/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nathwill/iptables-ng/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nathwill/iptables-ng/teams","hooks_url":"https://api.github.com/repos/nathwill/iptables-ng/hooks","issue_events_url":"https://api.github.com/repos/nathwill/iptables-ng/issues/events{/number}","events_url":"https://api.github.com/repos/nathwill/iptables-ng/events","assignees_url":"https://api.github.com/repos/nathwill/iptables-ng/assignees{/user}","branches_url":"https://api.github.com/repos/nathwill/iptables-ng/branches{/branch}","tags_url":"https://api.github.com/repos/nathwill/iptables-ng/tags","blobs_url":"https://api.github.com/repos/nathwill/iptables-ng/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nathwill/iptables-ng/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nathwill/iptables-ng/git/refs{/sha}","trees_url":"https://api.github.com/repos/nathwill/iptables-ng/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nathwill/iptables-ng/statuses/{sha}","languages_url":"https://api.github.com/repos/nathwill/iptables-ng/languages","stargazers_url":"https://api.github.com/repos/nathwill/iptables-ng/stargazers","contributors_url":"https://api.github.com/repos/nathwill/iptables-ng/contributors","subscribers_url":"https://api.github.com/repos/nathwill/iptables-ng/subscribers","subscription_url":"https://api.github.com/repos/nathwill/iptables-ng/subscription","commits_url":"https://api.github.com/repos/nathwill/iptables-ng/commits{/sha}","git_commits_url":"https://api.github.com/repos/nathwill/iptables-ng/git/commits{/sha}","comments_url":"https://api.github.com/repos/nathwill/iptables-ng/comments{/number}","issue_comment_url":"https://api.github.com/repos/nathwill/iptables-ng/issues/comments{/number}","contents_url":"https://api.github.com/repos/nathwill/iptables-ng/contents/{+path}","compare_url":"https://api.github.com/repos/nathwill/iptables-ng/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nathwill/iptables-ng/merges","archive_url":"https://api.github.com/repos/nathwill/iptables-ng/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nathwill/iptables-ng/downloads","issues_url":"https://api.github.com/repos/nathwill/iptables-ng/issues{/number}","pulls_url":"https://api.github.com/repos/nathwill/iptables-ng/pulls{/number}","milestones_url":"https://api.github.com/repos/nathwill/iptables-ng/milestones{/number}","notifications_url":"https://api.github.com/repos/nathwill/iptables-ng/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nathwill/iptables-ng/labels{/name}","releases_url":"https://api.github.com/repos/nathwill/iptables-ng/releases{/id}","created_at":"2014-11-03T20:16:04Z","updated_at":"2015-08-24T04:20:57Z","pushed_at":"2015-12-06T04:23:26Z","git_url":"git://github.com/nathwill/iptables-ng.git","ssh_url":"git@github.com:nathwill/iptables-ng.git","clone_url":"https://github.com/nathwill/iptables-ng.git","svn_url":"https://github.com/nathwill/iptables-ng","homepage":null,"size":208,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"chr4-cookbooks:master","ref":"master","sha":"bc8bf99bb80918552aa191f1398d17bf29f47e5b","user":{"login":"chr4-cookbooks","id":5455993,"avatar_url":"https://avatars.githubusercontent.com/u/5455993?v=3","gravatar_id":"","url":"https://api.github.com/users/chr4-cookbooks","html_url":"https://github.com/chr4-cookbooks","followers_url":"https://api.github.com/users/chr4-cookbooks/followers","following_url":"https://api.github.com/users/chr4-cookbooks/following{/other_user}","gists_url":"https://api.github.com/users/chr4-cookbooks/gists{/gist_id}","starred_url":"https://api.github.com/users/chr4-cookbooks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chr4-cookbooks/subscriptions","organizations_url":"https://api.github.com/users/chr4-cookbooks/orgs","repos_url":"https://api.github.com/users/chr4-cookbooks/repos","events_url":"https://api.github.com/users/chr4-cookbooks/events{/privacy}","received_events_url":"https://api.github.com/users/chr4-cookbooks/received_events","type":"Organization","site_admin":false},"repo":{"id":12804619,"name":"iptables-ng","full_name":"chr4-cookbooks/iptables-ng","owner":{"login":"chr4-cookbooks","id":5455993,"avatar_url":"https://avatars.githubusercontent.com/u/5455993?v=3","gravatar_id":"","url":"https://api.github.com/users/chr4-cookbooks","html_url":"https://github.com/chr4-cookbooks","followers_url":"https://api.github.com/users/chr4-cookbooks/followers","following_url":"https://api.github.com/users/chr4-cookbooks/following{/other_user}","gists_url":"https://api.github.com/users/chr4-cookbooks/gists{/gist_id}","starred_url":"https://api.github.com/users/chr4-cookbooks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chr4-cookbooks/subscriptions","organizations_url":"https://api.github.com/users/chr4-cookbooks/orgs","repos_url":"https://api.github.com/users/chr4-cookbooks/repos","events_url":"https://api.github.com/users/chr4-cookbooks/events{/privacy}","received_events_url":"https://api.github.com/users/chr4-cookbooks/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/chr4-cookbooks/iptables-ng","description":"Cookbook to maintain iptables rules and policies on different platforms, respecting the way the os handles these settings.","fork":false,"url":"https://api.github.com/repos/chr4-cookbooks/iptables-ng","forks_url":"https://api.github.com/repos/chr4-cookbooks/iptables-ng/forks","keys_url":"https://api.github.com/repos/chr4-cookbooks/iptables-ng/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chr4-cookbooks/iptables-ng/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chr4-cookbooks/iptables-ng/teams","hooks_url":"https://api.github.com/repos/chr4-cookbooks/iptables-ng/hooks","issue_events_url":"https://api.github.com/repos/chr4-cookbooks/iptables-ng/issues/events{/number}","events_url":"https://api.github.com/repos/chr4-cookbooks/iptables-ng/events","assignees_url":"https://api.github.com/repos/chr4-cookbooks/iptables-ng/assignees{/user}","branches_url":"https://api.github.com/repos/chr4-cookbooks/iptables-ng/branches{/branch}","tags_url":"https://api.github.com/repos/chr4-cookbooks/iptables-ng/tags","blobs_url":"https://api.github.com/repos/chr4-cookbooks/iptables-ng/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chr4-cookbooks/iptables-ng/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chr4-cookbooks/iptables-ng/git/refs{/sha}","trees_url":"https://api.github.com/repos/chr4-cookbooks/iptables-ng/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chr4-cookbooks/iptables-ng/statuses/{sha}","languages_url":"https://api.github.com/repos/chr4-cookbooks/iptables-ng/languages","stargazers_url":"https://api.github.com/repos/chr4-cookbooks/iptables-ng/stargazers","contributors_url":"https://api.github.com/repos/chr4-cookbooks/iptables-ng/contributors","subscribers_url":"https://api.github.com/repos/chr4-cookbooks/iptables-ng/subscribers","subscription_url":"https://api.github.com/repos/chr4-cookbooks/iptables-ng/subscription","commits_url":"https://api.github.com/repos/chr4-cookbooks/iptables-ng/commits{/sha}","git_commits_url":"https://api.github.com/repos/chr4-cookbooks/iptables-ng/git/commits{/sha}","comments_url":"https://api.github.com/repos/chr4-cookbooks/iptables-ng/comments{/number}","issue_comment_url":"https://api.github.com/repos/chr4-cookbooks/iptables-ng/issues/comments{/number}","contents_url":"https://api.github.com/repos/chr4-cookbooks/iptables-ng/contents/{+path}","compare_url":"https://api.github.com/repos/chr4-cookbooks/iptables-ng/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chr4-cookbooks/iptables-ng/merges","archive_url":"https://api.github.com/repos/chr4-cookbooks/iptables-ng/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chr4-cookbooks/iptables-ng/downloads","issues_url":"https://api.github.com/repos/chr4-cookbooks/iptables-ng/issues{/number}","pulls_url":"https://api.github.com/repos/chr4-cookbooks/iptables-ng/pulls{/number}","milestones_url":"https://api.github.com/repos/chr4-cookbooks/iptables-ng/milestones{/number}","notifications_url":"https://api.github.com/repos/chr4-cookbooks/iptables-ng/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chr4-cookbooks/iptables-ng/labels{/name}","releases_url":"https://api.github.com/repos/chr4-cookbooks/iptables-ng/releases{/id}","created_at":"2013-09-13T08:09:34Z","updated_at":"2015-12-08T10:02:33Z","pushed_at":"2015-12-06T04:23:27Z","git_url":"git://github.com/chr4-cookbooks/iptables-ng.git","ssh_url":"git@github.com:chr4-cookbooks/iptables-ng.git","clone_url":"https://github.com/chr4-cookbooks/iptables-ng.git","svn_url":"https://github.com/chr4-cookbooks/iptables-ng","homepage":null,"size":743,"stargazers_count":33,"watchers_count":33,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":26,"mirror_url":null,"open_issues_count":6,"forks":26,"open_issues":6,"watchers":33,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/chr4-cookbooks/iptables-ng/pulls/56"},"html":{"href":"https://github.com/chr4-cookbooks/iptables-ng/pull/56"},"issue":{"href":"https://api.github.com/repos/chr4-cookbooks/iptables-ng/issues/56"},"comments":{"href":"https://api.github.com/repos/chr4-cookbooks/iptables-ng/issues/56/comments"},"review_comments":{"href":"https://api.github.com/repos/chr4-cookbooks/iptables-ng/pulls/56/comments"},"review_comment":{"href":"https://api.github.com/repos/chr4-cookbooks/iptables-ng/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/chr4-cookbooks/iptables-ng/pulls/56/commits"},"statuses":{"href":"https://api.github.com/repos/chr4-cookbooks/iptables-ng/statuses/f8f979b99dd61dfb2b6288ef8d030b3354475708"}}}}