GitHub PullRequestReviewCommentEvent at 2014-07-17 21:24:14
Repository: kafka-cookbook
Actor: mthssdrbrg
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/mthssdrbrg/kafka-cookbook/pulls/comments/15085144","id":15085144,"diff_hunk":"@@ -0,0 +1,77 @@\n+class KafkaError < RuntimeError; end\n+\n+def whyrun_supported?\n+  true\n+end\n+\n+action :create do\n+  converge_by(\"Creating topic #{@new_resource.name}\") do\n+    create_topic(@new_resource.name)\n+    resname = @new_resource.name\n+    ruby_block \"verify_topic\" do\n+      block do\n+        if !topic_exists?(resname)\n+          Chef::Log.info \"topic was not created #{resname}.\"        \n+        else\n+          Chef::Log.info \"topic was created #{resname}\"\n+        end\n+      end\n+      action :create\n+    end\n+  end  \n+end\n+\n+action :update do\n+  converge_by(\"Updating configuration for topic #{@new_resource.name}\") do\n+    alter_topic(@new_resource.name)\n+  end\n+end\n+\n+def topic_exists?(topic_name)\n+  listCmd = \"#{@topic_cmd} --list --zookeeper #{@zk_hosts} | grep -i #{@new_resource.name}\"\n+  cmd = Mixlib::ShellOut.new(listCmd)\n+  cmd.run_command\n+  begin    \n+    cmd.error!\n+    return true\n+  rescue\n+    return false","path":"providers/topic.rb","position":38,"original_position":38,"commit_id":"cf70c6fa755324e1e28f3d5d6eee6f0cb95ef164","original_commit_id":"cf70c6fa755324e1e28f3d5d6eee6f0cb95ef164","user":{"login":"mthssdrbrg","id":908270,"avatar_url":"https://avatars.githubusercontent.com/u/908270?","gravatar_id":"89f75c92933676a1246af3999774f7fd","url":"https://api.github.com/users/mthssdrbrg","html_url":"https://github.com/mthssdrbrg","followers_url":"https://api.github.com/users/mthssdrbrg/followers","following_url":"https://api.github.com/users/mthssdrbrg/following{/other_user}","gists_url":"https://api.github.com/users/mthssdrbrg/gists{/gist_id}","starred_url":"https://api.github.com/users/mthssdrbrg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mthssdrbrg/subscriptions","organizations_url":"https://api.github.com/users/mthssdrbrg/orgs","repos_url":"https://api.github.com/users/mthssdrbrg/repos","events_url":"https://api.github.com/users/mthssdrbrg/events{/privacy}","received_events_url":"https://api.github.com/users/mthssdrbrg/received_events","type":"User","site_admin":false},"body":"I'd prefer to actually log the exception.","created_at":"2014-07-17T21:24:14Z","updated_at":"2014-07-17T21:24:14Z","html_url":"https://github.com/mthssdrbrg/kafka-cookbook/pull/49#discussion_r15085144","pull_request_url":"https://api.github.com/repos/mthssdrbrg/kafka-cookbook/pulls/49","_links":{"self":{"href":"https://api.github.com/repos/mthssdrbrg/kafka-cookbook/pulls/comments/15085144"},"html":{"href":"https://github.com/mthssdrbrg/kafka-cookbook/pull/49#discussion_r15085144"},"pull_request":{"href":"https://api.github.com/repos/mthssdrbrg/kafka-cookbook/pulls/49"}}},"pull_request":{"url":"https://api.github.com/repos/mthssdrbrg/kafka-cookbook/pulls/49","id":18545293,"html_url":"https://github.com/mthssdrbrg/kafka-cookbook/pull/49","diff_url":"https://github.com/mthssdrbrg/kafka-cookbook/pull/49.diff","patch_url":"https://github.com/mthssdrbrg/kafka-cookbook/pull/49.patch","issue_url":"https://api.github.com/repos/mthssdrbrg/kafka-cookbook/issues/49","number":49,"state":"open","title":"Added an LWRP to create kafka topic","user":{"login":"amithkanand","id":6287145,"avatar_url":"https://avatars.githubusercontent.com/u/6287145?","gravatar_id":"ad396e67b3d063947552b9e745637c2f","url":"https://api.github.com/users/amithkanand","html_url":"https://github.com/amithkanand","followers_url":"https://api.github.com/users/amithkanand/followers","following_url":"https://api.github.com/users/amithkanand/following{/other_user}","gists_url":"https://api.github.com/users/amithkanand/gists{/gist_id}","starred_url":"https://api.github.com/users/amithkanand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amithkanand/subscriptions","organizations_url":"https://api.github.com/users/amithkanand/orgs","repos_url":"https://api.github.com/users/amithkanand/repos","events_url":"https://api.github.com/users/amithkanand/events{/privacy}","received_events_url":"https://api.github.com/users/amithkanand/received_events","type":"User","site_admin":false},"body":"Added a new resource/provider to create/modify Kafka topics.","created_at":"2014-07-17T18:24:17Z","updated_at":"2014-07-17T21:24:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0c162584b67cf2fb5791fe49e462b295ef1ffd43","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mthssdrbrg/kafka-cookbook/pulls/49/commits","review_comments_url":"https://api.github.com/repos/mthssdrbrg/kafka-cookbook/pulls/49/comments","review_comment_url":"https://api.github.com/repos/mthssdrbrg/kafka-cookbook/pulls/comments/{number}","comments_url":"https://api.github.com/repos/mthssdrbrg/kafka-cookbook/issues/49/comments","statuses_url":"https://api.github.com/repos/mthssdrbrg/kafka-cookbook/statuses/cf70c6fa755324e1e28f3d5d6eee6f0cb95ef164","head":{"label":"amithkanand:kafka_lwrp","ref":"kafka_lwrp","sha":"cf70c6fa755324e1e28f3d5d6eee6f0cb95ef164","user":{"login":"amithkanand","id":6287145,"avatar_url":"https://avatars.githubusercontent.com/u/6287145?","gravatar_id":"ad396e67b3d063947552b9e745637c2f","url":"https://api.github.com/users/amithkanand","html_url":"https://github.com/amithkanand","followers_url":"https://api.github.com/users/amithkanand/followers","following_url":"https://api.github.com/users/amithkanand/following{/other_user}","gists_url":"https://api.github.com/users/amithkanand/gists{/gist_id}","starred_url":"https://api.github.com/users/amithkanand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amithkanand/subscriptions","organizations_url":"https://api.github.com/users/amithkanand/orgs","repos_url":"https://api.github.com/users/amithkanand/repos","events_url":"https://api.github.com/users/amithkanand/events{/privacy}","received_events_url":"https://api.github.com/users/amithkanand/received_events","type":"User","site_admin":false},"repo":{"id":20730442,"name":"kafka-cookbook","full_name":"amithkanand/kafka-cookbook","owner":{"login":"amithkanand","id":6287145,"avatar_url":"https://avatars.githubusercontent.com/u/6287145?","gravatar_id":"ad396e67b3d063947552b9e745637c2f","url":"https://api.github.com/users/amithkanand","html_url":"https://github.com/amithkanand","followers_url":"https://api.github.com/users/amithkanand/followers","following_url":"https://api.github.com/users/amithkanand/following{/other_user}","gists_url":"https://api.github.com/users/amithkanand/gists{/gist_id}","starred_url":"https://api.github.com/users/amithkanand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amithkanand/subscriptions","organizations_url":"https://api.github.com/users/amithkanand/orgs","repos_url":"https://api.github.com/users/amithkanand/repos","events_url":"https://api.github.com/users/amithkanand/events{/privacy}","received_events_url":"https://api.github.com/users/amithkanand/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/amithkanand/kafka-cookbook","description":"Chef cookbook for Kafka","fork":true,"url":"https://api.github.com/repos/amithkanand/kafka-cookbook","forks_url":"https://api.github.com/repos/amithkanand/kafka-cookbook/forks","keys_url":"https://api.github.com/repos/amithkanand/kafka-cookbook/keys{/key_id}","collaborators_url":"https://api.github.com/repos/amithkanand/kafka-cookbook/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/amithkanand/kafka-cookbook/teams","hooks_url":"https://api.github.com/repos/amithkanand/kafka-cookbook/hooks","issue_events_url":"https://api.github.com/repos/amithkanand/kafka-cookbook/issues/events{/number}","events_url":"https://api.github.com/repos/amithkanand/kafka-cookbook/events","assignees_url":"https://api.github.com/repos/amithkanand/kafka-cookbook/assignees{/user}","branches_url":"https://api.github.com/repos/amithkanand/kafka-cookbook/branches{/branch}","tags_url":"https://api.github.com/repos/amithkanand/kafka-cookbook/tags","blobs_url":"https://api.github.com/repos/amithkanand/kafka-cookbook/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/amithkanand/kafka-cookbook/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/amithkanand/kafka-cookbook/git/refs{/sha}","trees_url":"https://api.github.com/repos/amithkanand/kafka-cookbook/git/trees{/sha}","statuses_url":"https://api.github.com/repos/amithkanand/kafka-cookbook/statuses/{sha}","languages_url":"https://api.github.com/repos/amithkanand/kafka-cookbook/languages","stargazers_url":"https://api.github.com/repos/amithkanand/kafka-cookbook/stargazers","contributors_url":"https://api.github.com/repos/amithkanand/kafka-cookbook/contributors","subscribers_url":"https://api.github.com/repos/amithkanand/kafka-cookbook/subscribers","subscription_url":"https://api.github.com/repos/amithkanand/kafka-cookbook/subscription","commits_url":"https://api.github.com/repos/amithkanand/kafka-cookbook/commits{/sha}","git_commits_url":"https://api.github.com/repos/amithkanand/kafka-cookbook/git/commits{/sha}","comments_url":"https://api.github.com/repos/amithkanand/kafka-cookbook/comments{/number}","issue_comment_url":"https://api.github.com/repos/amithkanand/kafka-cookbook/issues/comments/{number}","contents_url":"https://api.github.com/repos/amithkanand/kafka-cookbook/contents/{+path}","compare_url":"https://api.github.com/repos/amithkanand/kafka-cookbook/compare/{base}...{head}","merges_url":"https://api.github.com/repos/amithkanand/kafka-cookbook/merges","archive_url":"https://api.github.com/repos/amithkanand/kafka-cookbook/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/amithkanand/kafka-cookbook/downloads","issues_url":"https://api.github.com/repos/amithkanand/kafka-cookbook/issues{/number}","pulls_url":"https://api.github.com/repos/amithkanand/kafka-cookbook/pulls{/number}","milestones_url":"https://api.github.com/repos/amithkanand/kafka-cookbook/milestones{/number}","notifications_url":"https://api.github.com/repos/amithkanand/kafka-cookbook/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/amithkanand/kafka-cookbook/labels{/name}","releases_url":"https://api.github.com/repos/amithkanand/kafka-cookbook/releases{/id}","created_at":"2014-06-11T15:26:46Z","updated_at":"2014-07-11T15:11:12Z","pushed_at":"2014-07-17T20:47:17Z","git_url":"git://github.com/amithkanand/kafka-cookbook.git","ssh_url":"git@github.com:amithkanand/kafka-cookbook.git","clone_url":"https://github.com/amithkanand/kafka-cookbook.git","svn_url":"https://github.com/amithkanand/kafka-cookbook","homepage":"","size":671,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"mthssdrbrg:master","ref":"master","sha":"8ee48014bd92d2449e7d264b59398a730c3715f7","user":{"login":"mthssdrbrg","id":908270,"avatar_url":"https://avatars.githubusercontent.com/u/908270?","gravatar_id":"89f75c92933676a1246af3999774f7fd","url":"https://api.github.com/users/mthssdrbrg","html_url":"https://github.com/mthssdrbrg","followers_url":"https://api.github.com/users/mthssdrbrg/followers","following_url":"https://api.github.com/users/mthssdrbrg/following{/other_user}","gists_url":"https://api.github.com/users/mthssdrbrg/gists{/gist_id}","starred_url":"https://api.github.com/users/mthssdrbrg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mthssdrbrg/subscriptions","organizations_url":"https://api.github.com/users/mthssdrbrg/orgs","repos_url":"https://api.github.com/users/mthssdrbrg/repos","events_url":"https://api.github.com/users/mthssdrbrg/events{/privacy}","received_events_url":"https://api.github.com/users/mthssdrbrg/received_events","type":"User","site_admin":false},"repo":{"id":11219679,"name":"kafka-cookbook","full_name":"mthssdrbrg/kafka-cookbook","owner":{"login":"mthssdrbrg","id":908270,"avatar_url":"https://avatars.githubusercontent.com/u/908270?","gravatar_id":"89f75c92933676a1246af3999774f7fd","url":"https://api.github.com/users/mthssdrbrg","html_url":"https://github.com/mthssdrbrg","followers_url":"https://api.github.com/users/mthssdrbrg/followers","following_url":"https://api.github.com/users/mthssdrbrg/following{/other_user}","gists_url":"https://api.github.com/users/mthssdrbrg/gists{/gist_id}","starred_url":"https://api.github.com/users/mthssdrbrg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mthssdrbrg/subscriptions","organizations_url":"https://api.github.com/users/mthssdrbrg/orgs","repos_url":"https://api.github.com/users/mthssdrbrg/repos","events_url":"https://api.github.com/users/mthssdrbrg/events{/privacy}","received_events_url":"https://api.github.com/users/mthssdrbrg/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mthssdrbrg/kafka-cookbook","description":"Chef cookbook for Kafka","fork":false,"url":"https://api.github.com/repos/mthssdrbrg/kafka-cookbook","forks_url":"https://api.github.com/repos/mthssdrbrg/kafka-cookbook/forks","keys_url":"https://api.github.com/repos/mthssdrbrg/kafka-cookbook/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mthssdrbrg/kafka-cookbook/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mthssdrbrg/kafka-cookbook/teams","hooks_url":"https://api.github.com/repos/mthssdrbrg/kafka-cookbook/hooks","issue_events_url":"https://api.github.com/repos/mthssdrbrg/kafka-cookbook/issues/events{/number}","events_url":"https://api.github.com/repos/mthssdrbrg/kafka-cookbook/events","assignees_url":"https://api.github.com/repos/mthssdrbrg/kafka-cookbook/assignees{/user}","branches_url":"https://api.github.com/repos/mthssdrbrg/kafka-cookbook/branches{/branch}","tags_url":"https://api.github.com/repos/mthssdrbrg/kafka-cookbook/tags","blobs_url":"https://api.github.com/repos/mthssdrbrg/kafka-cookbook/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mthssdrbrg/kafka-cookbook/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mthssdrbrg/kafka-cookbook/git/refs{/sha}","trees_url":"https://api.github.com/repos/mthssdrbrg/kafka-cookbook/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mthssdrbrg/kafka-cookbook/statuses/{sha}","languages_url":"https://api.github.com/repos/mthssdrbrg/kafka-cookbook/languages","stargazers_url":"https://api.github.com/repos/mthssdrbrg/kafka-cookbook/stargazers","contributors_url":"https://api.github.com/repos/mthssdrbrg/kafka-cookbook/contributors","subscribers_url":"https://api.github.com/repos/mthssdrbrg/kafka-cookbook/subscribers","subscription_url":"https://api.github.com/repos/mthssdrbrg/kafka-cookbook/subscription","commits_url":"https://api.github.com/repos/mthssdrbrg/kafka-cookbook/commits{/sha}","git_commits_url":"https://api.github.com/repos/mthssdrbrg/kafka-cookbook/git/commits{/sha}","comments_url":"https://api.github.com/repos/mthssdrbrg/kafka-cookbook/comments{/number}","issue_comment_url":"https://api.github.com/repos/mthssdrbrg/kafka-cookbook/issues/comments/{number}","contents_url":"https://api.github.com/repos/mthssdrbrg/kafka-cookbook/contents/{+path}","compare_url":"https://api.github.com/repos/mthssdrbrg/kafka-cookbook/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mthssdrbrg/kafka-cookbook/merges","archive_url":"https://api.github.com/repos/mthssdrbrg/kafka-cookbook/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mthssdrbrg/kafka-cookbook/downloads","issues_url":"https://api.github.com/repos/mthssdrbrg/kafka-cookbook/issues{/number}","pulls_url":"https://api.github.com/repos/mthssdrbrg/kafka-cookbook/pulls{/number}","milestones_url":"https://api.github.com/repos/mthssdrbrg/kafka-cookbook/milestones{/number}","notifications_url":"https://api.github.com/repos/mthssdrbrg/kafka-cookbook/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mthssdrbrg/kafka-cookbook/labels{/name}","releases_url":"https://api.github.com/repos/mthssdrbrg/kafka-cookbook/releases{/id}","created_at":"2013-07-06T15:01:06Z","updated_at":"2014-07-03T06:46:41Z","pushed_at":"2014-07-11T20:42:41Z","git_url":"git://github.com/mthssdrbrg/kafka-cookbook.git","ssh_url":"git@github.com:mthssdrbrg/kafka-cookbook.git","clone_url":"https://github.com/mthssdrbrg/kafka-cookbook.git","svn_url":"https://github.com/mthssdrbrg/kafka-cookbook","homepage":"","size":2760,"stargazers_count":24,"watchers_count":24,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":29,"mirror_url":null,"open_issues_count":11,"forks":29,"open_issues":11,"watchers":24,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mthssdrbrg/kafka-cookbook/pulls/49"},"html":{"href":"https://github.com/mthssdrbrg/kafka-cookbook/pull/49"},"issue":{"href":"https://api.github.com/repos/mthssdrbrg/kafka-cookbook/issues/49"},"comments":{"href":"https://api.github.com/repos/mthssdrbrg/kafka-cookbook/issues/49/comments"},"review_comments":{"href":"https://api.github.com/repos/mthssdrbrg/kafka-cookbook/pulls/49/comments"},"review_comment":{"href":"https://api.github.com/repos/mthssdrbrg/kafka-cookbook/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/mthssdrbrg/kafka-cookbook/pulls/49/commits"},"statuses":{"href":"https://api.github.com/repos/mthssdrbrg/kafka-cookbook/statuses/cf70c6fa755324e1e28f3d5d6eee6f0cb95ef164"}}}}