{"action":"created","comment":{"url":"https://api.github.com/repos/Yelp/kafka-utils/pulls/comments/193411548","pull_request_review_id":126377098,"id":193411548,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5MzQxMTU0OA==","diff_hunk":"@@ -80,6 +90,14 @@ def is_controller(zk, broker_id):\n     return broker_id == zk.get_json('/controller').get('brokerid')\n \n \n-def is_first_broker(zk, broker_id):\n+def get_broker_ids(zk):\n+    \"\"\"Returns a list of integers for broker ids\"\"\"\n+    return list(zk.get_brokers())\n+\n+\n+def is_first_broker(broker_ids, broker_id):\n     \"\"\"Returns true if broker_id is the lowest broker id in the cluster, false otherwise.\"\"\"\n-    return broker_id == min(zk.get_brokers().keys())\n+    if not broker_ids:","path":"kafka_utils/kafka_check/commands/command.py","position":39,"original_position":39,"commit_id":"6c2b28c98916fff746a16ef5b1bc30e8a5def5e9","original_commit_id":"6c2b28c98916fff746a16ef5b1bc30e8a5def5e9","user":{"login":"flavray","id":4570851,"node_id":"MDQ6VXNlcjQ1NzA4NTE=","avatar_url":"https://avatars0.githubusercontent.com/u/4570851?v=4","gravatar_id":"","url":"https://api.github.com/users/flavray","html_url":"https://github.com/flavray","followers_url":"https://api.github.com/users/flavray/followers","following_url":"https://api.github.com/users/flavray/following{/other_user}","gists_url":"https://api.github.com/users/flavray/gists{/gist_id}","starred_url":"https://api.github.com/users/flavray/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flavray/subscriptions","organizations_url":"https://api.github.com/users/flavray/orgs","repos_url":"https://api.github.com/users/flavray/repos","events_url":"https://api.github.com/users/flavray/events{/privacy}","received_events_url":"https://api.github.com/users/flavray/received_events","type":"User","site_admin":false},"body":"This can probably just be `broker_ids and broker_id == min(broker_ids)` 🙂","created_at":"2018-06-06T13:35:56Z","updated_at":"2018-06-06T13:35:57Z","html_url":"https://github.com/Yelp/kafka-utils/pull/169#discussion_r193411548","pull_request_url":"https://api.github.com/repos/Yelp/kafka-utils/pulls/169","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/Yelp/kafka-utils/pulls/comments/193411548"},"html":{"href":"https://github.com/Yelp/kafka-utils/pull/169#discussion_r193411548"},"pull_request":{"href":"https://api.github.com/repos/Yelp/kafka-utils/pulls/169"}}},"pull_request":{"url":"https://api.github.com/repos/Yelp/kafka-utils/pulls/169","id":192488815,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkyNDg4ODE1","html_url":"https://github.com/Yelp/kafka-utils/pull/169","diff_url":"https://github.com/Yelp/kafka-utils/pull/169.diff","patch_url":"https://github.com/Yelp/kafka-utils/pull/169.patch","issue_url":"https://api.github.com/repos/Yelp/kafka-utils/issues/169","number":169,"state":"open","locked":false,"title":"kafka-check command checks for empty broker ids before running command","user":{"login":"morningsend","id":4951174,"node_id":"MDQ6VXNlcjQ5NTExNzQ=","avatar_url":"https://avatars2.githubusercontent.com/u/4951174?v=4","gravatar_id":"","url":"https://api.github.com/users/morningsend","html_url":"https://github.com/morningsend","followers_url":"https://api.github.com/users/morningsend/followers","following_url":"https://api.github.com/users/morningsend/following{/other_user}","gists_url":"https://api.github.com/users/morningsend/gists{/gist_id}","starred_url":"https://api.github.com/users/morningsend/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/morningsend/subscriptions","organizations_url":"https://api.github.com/users/morningsend/orgs","repos_url":"https://api.github.com/users/morningsend/repos","events_url":"https://api.github.com/users/morningsend/events{/privacy}","received_events_url":"https://api.github.com/users/morningsend/received_events","type":"User","site_admin":false},"body":"- refactored is_first_broker method \r\n- added unit tests","created_at":"2018-06-04T18:19:46Z","updated_at":"2018-06-06T13:35:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f07f0a9c234c9e86ea75df7a85c2fc3f60c98d74","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Yelp/kafka-utils/pulls/169/commits","review_comments_url":"https://api.github.com/repos/Yelp/kafka-utils/pulls/169/comments","review_comment_url":"https://api.github.com/repos/Yelp/kafka-utils/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Yelp/kafka-utils/issues/169/comments","statuses_url":"https://api.github.com/repos/Yelp/kafka-utils/statuses/6c2b28c98916fff746a16ef5b1bc30e8a5def5e9","head":{"label":"morningsend:KAFKA-9749_fix_empty_broker_ids_throw_exception","ref":"KAFKA-9749_fix_empty_broker_ids_throw_exception","sha":"6c2b28c98916fff746a16ef5b1bc30e8a5def5e9","user":{"login":"morningsend","id":4951174,"node_id":"MDQ6VXNlcjQ5NTExNzQ=","avatar_url":"https://avatars2.githubusercontent.com/u/4951174?v=4","gravatar_id":"","url":"https://api.github.com/users/morningsend","html_url":"https://github.com/morningsend","followers_url":"https://api.github.com/users/morningsend/followers","following_url":"https://api.github.com/users/morningsend/following{/other_user}","gists_url":"https://api.github.com/users/morningsend/gists{/gist_id}","starred_url":"https://api.github.com/users/morningsend/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/morningsend/subscriptions","organizations_url":"https://api.github.com/users/morningsend/orgs","repos_url":"https://api.github.com/users/morningsend/repos","events_url":"https://api.github.com/users/morningsend/events{/privacy}","received_events_url":"https://api.github.com/users/morningsend/received_events","type":"User","site_admin":false},"repo":{"id":136058085,"node_id":"MDEwOlJlcG9zaXRvcnkxMzYwNTgwODU=","name":"kafka-utils","full_name":"morningsend/kafka-utils","owner":{"login":"morningsend","id":4951174,"node_id":"MDQ6VXNlcjQ5NTExNzQ=","avatar_url":"https://avatars2.githubusercontent.com/u/4951174?v=4","gravatar_id":"","url":"https://api.github.com/users/morningsend","html_url":"https://github.com/morningsend","followers_url":"https://api.github.com/users/morningsend/followers","following_url":"https://api.github.com/users/morningsend/following{/other_user}","gists_url":"https://api.github.com/users/morningsend/gists{/gist_id}","starred_url":"https://api.github.com/users/morningsend/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/morningsend/subscriptions","organizations_url":"https://api.github.com/users/morningsend/orgs","repos_url":"https://api.github.com/users/morningsend/repos","events_url":"https://api.github.com/users/morningsend/events{/privacy}","received_events_url":"https://api.github.com/users/morningsend/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/morningsend/kafka-utils","description":null,"fork":true,"url":"https://api.github.com/repos/morningsend/kafka-utils","forks_url":"https://api.github.com/repos/morningsend/kafka-utils/forks","keys_url":"https://api.github.com/repos/morningsend/kafka-utils/keys{/key_id}","collaborators_url":"https://api.github.com/repos/morningsend/kafka-utils/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/morningsend/kafka-utils/teams","hooks_url":"https://api.github.com/repos/morningsend/kafka-utils/hooks","issue_events_url":"https://api.github.com/repos/morningsend/kafka-utils/issues/events{/number}","events_url":"https://api.github.com/repos/morningsend/kafka-utils/events","assignees_url":"https://api.github.com/repos/morningsend/kafka-utils/assignees{/user}","branches_url":"https://api.github.com/repos/morningsend/kafka-utils/branches{/branch}","tags_url":"https://api.github.com/repos/morningsend/kafka-utils/tags","blobs_url":"https://api.github.com/repos/morningsend/kafka-utils/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/morningsend/kafka-utils/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/morningsend/kafka-utils/git/refs{/sha}","trees_url":"https://api.github.com/repos/morningsend/kafka-utils/git/trees{/sha}","statuses_url":"https://api.github.com/repos/morningsend/kafka-utils/statuses/{sha}","languages_url":"https://api.github.com/repos/morningsend/kafka-utils/languages","stargazers_url":"https://api.github.com/repos/morningsend/kafka-utils/stargazers","contributors_url":"https://api.github.com/repos/morningsend/kafka-utils/contributors","subscribers_url":"https://api.github.com/repos/morningsend/kafka-utils/subscribers","subscription_url":"https://api.github.com/repos/morningsend/kafka-utils/subscription","commits_url":"https://api.github.com/repos/morningsend/kafka-utils/commits{/sha}","git_commits_url":"https://api.github.com/repos/morningsend/kafka-utils/git/commits{/sha}","comments_url":"https://api.github.com/repos/morningsend/kafka-utils/comments{/number}","issue_comment_url":"https://api.github.com/repos/morningsend/kafka-utils/issues/comments{/number}","contents_url":"https://api.github.com/repos/morningsend/kafka-utils/contents/{+path}","compare_url":"https://api.github.com/repos/morningsend/kafka-utils/compare/{base}...{head}","merges_url":"https://api.github.com/repos/morningsend/kafka-utils/merges","archive_url":"https://api.github.com/repos/morningsend/kafka-utils/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/morningsend/kafka-utils/downloads","issues_url":"https://api.github.com/repos/morningsend/kafka-utils/issues{/number}","pulls_url":"https://api.github.com/repos/morningsend/kafka-utils/pulls{/number}","milestones_url":"https://api.github.com/repos/morningsend/kafka-utils/milestones{/number}","notifications_url":"https://api.github.com/repos/morningsend/kafka-utils/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/morningsend/kafka-utils/labels{/name}","releases_url":"https://api.github.com/repos/morningsend/kafka-utils/releases{/id}","deployments_url":"https://api.github.com/repos/morningsend/kafka-utils/deployments","created_at":"2018-06-04T17:09:47Z","updated_at":"2018-06-06T10:53:47Z","pushed_at":"2018-06-06T12:29:29Z","git_url":"git://github.com/morningsend/kafka-utils.git","ssh_url":"git@github.com:morningsend/kafka-utils.git","clone_url":"https://github.com/morningsend/kafka-utils.git","svn_url":"https://github.com/morningsend/kafka-utils","homepage":null,"size":2219,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Yelp:master","ref":"master","sha":"9d9608ceb02b17069aa1e1213860e6959465677b","user":{"login":"Yelp","id":49071,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ5MDcx","avatar_url":"https://avatars1.githubusercontent.com/u/49071?v=4","gravatar_id":"","url":"https://api.github.com/users/Yelp","html_url":"https://github.com/Yelp","followers_url":"https://api.github.com/users/Yelp/followers","following_url":"https://api.github.com/users/Yelp/following{/other_user}","gists_url":"https://api.github.com/users/Yelp/gists{/gist_id}","starred_url":"https://api.github.com/users/Yelp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yelp/subscriptions","organizations_url":"https://api.github.com/users/Yelp/orgs","repos_url":"https://api.github.com/users/Yelp/repos","events_url":"https://api.github.com/users/Yelp/events{/privacy}","received_events_url":"https://api.github.com/users/Yelp/received_events","type":"Organization","site_admin":false},"repo":{"id":55727134,"node_id":"MDEwOlJlcG9zaXRvcnk1NTcyNzEzNA==","name":"kafka-utils","full_name":"Yelp/kafka-utils","owner":{"login":"Yelp","id":49071,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ5MDcx","avatar_url":"https://avatars1.githubusercontent.com/u/49071?v=4","gravatar_id":"","url":"https://api.github.com/users/Yelp","html_url":"https://github.com/Yelp","followers_url":"https://api.github.com/users/Yelp/followers","following_url":"https://api.github.com/users/Yelp/following{/other_user}","gists_url":"https://api.github.com/users/Yelp/gists{/gist_id}","starred_url":"https://api.github.com/users/Yelp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yelp/subscriptions","organizations_url":"https://api.github.com/users/Yelp/orgs","repos_url":"https://api.github.com/users/Yelp/repos","events_url":"https://api.github.com/users/Yelp/events{/privacy}","received_events_url":"https://api.github.com/users/Yelp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Yelp/kafka-utils","description":null,"fork":false,"url":"https://api.github.com/repos/Yelp/kafka-utils","forks_url":"https://api.github.com/repos/Yelp/kafka-utils/forks","keys_url":"https://api.github.com/repos/Yelp/kafka-utils/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Yelp/kafka-utils/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Yelp/kafka-utils/teams","hooks_url":"https://api.github.com/repos/Yelp/kafka-utils/hooks","issue_events_url":"https://api.github.com/repos/Yelp/kafka-utils/issues/events{/number}","events_url":"https://api.github.com/repos/Yelp/kafka-utils/events","assignees_url":"https://api.github.com/repos/Yelp/kafka-utils/assignees{/user}","branches_url":"https://api.github.com/repos/Yelp/kafka-utils/branches{/branch}","tags_url":"https://api.github.com/repos/Yelp/kafka-utils/tags","blobs_url":"https://api.github.com/repos/Yelp/kafka-utils/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Yelp/kafka-utils/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Yelp/kafka-utils/git/refs{/sha}","trees_url":"https://api.github.com/repos/Yelp/kafka-utils/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Yelp/kafka-utils/statuses/{sha}","languages_url":"https://api.github.com/repos/Yelp/kafka-utils/languages","stargazers_url":"https://api.github.com/repos/Yelp/kafka-utils/stargazers","contributors_url":"https://api.github.com/repos/Yelp/kafka-utils/contributors","subscribers_url":"https://api.github.com/repos/Yelp/kafka-utils/subscribers","subscription_url":"https://api.github.com/repos/Yelp/kafka-utils/subscription","commits_url":"https://api.github.com/repos/Yelp/kafka-utils/commits{/sha}","git_commits_url":"https://api.github.com/repos/Yelp/kafka-utils/git/commits{/sha}","comments_url":"https://api.github.com/repos/Yelp/kafka-utils/comments{/number}","issue_comment_url":"https://api.github.com/repos/Yelp/kafka-utils/issues/comments{/number}","contents_url":"https://api.github.com/repos/Yelp/kafka-utils/contents/{+path}","compare_url":"https://api.github.com/repos/Yelp/kafka-utils/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Yelp/kafka-utils/merges","archive_url":"https://api.github.com/repos/Yelp/kafka-utils/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Yelp/kafka-utils/downloads","issues_url":"https://api.github.com/repos/Yelp/kafka-utils/issues{/number}","pulls_url":"https://api.github.com/repos/Yelp/kafka-utils/pulls{/number}","milestones_url":"https://api.github.com/repos/Yelp/kafka-utils/milestones{/number}","notifications_url":"https://api.github.com/repos/Yelp/kafka-utils/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Yelp/kafka-utils/labels{/name}","releases_url":"https://api.github.com/repos/Yelp/kafka-utils/releases{/id}","deployments_url":"https://api.github.com/repos/Yelp/kafka-utils/deployments","created_at":"2016-04-07T20:50:50Z","updated_at":"2018-06-05T17:29:57Z","pushed_at":"2018-06-06T12:29:32Z","git_url":"git://github.com/Yelp/kafka-utils.git","ssh_url":"git@github.com:Yelp/kafka-utils.git","clone_url":"https://github.com/Yelp/kafka-utils.git","svn_url":"https://github.com/Yelp/kafka-utils","homepage":null,"size":2242,"stargazers_count":117,"watchers_count":117,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":53,"mirror_url":null,"archived":false,"open_issues_count":17,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":53,"open_issues":17,"watchers":117,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Yelp/kafka-utils/pulls/169"},"html":{"href":"https://github.com/Yelp/kafka-utils/pull/169"},"issue":{"href":"https://api.github.com/repos/Yelp/kafka-utils/issues/169"},"comments":{"href":"https://api.github.com/repos/Yelp/kafka-utils/issues/169/comments"},"review_comments":{"href":"https://api.github.com/repos/Yelp/kafka-utils/pulls/169/comments"},"review_comment":{"href":"https://api.github.com/repos/Yelp/kafka-utils/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Yelp/kafka-utils/pulls/169/commits"},"statuses":{"href":"https://api.github.com/repos/Yelp/kafka-utils/statuses/6c2b28c98916fff746a16ef5b1bc30e8a5def5e9"}},"author_association":"NONE"}}
{"actor":{"display_login":"flavray"}}