{"action":"created","comment":{"url":"https://api.github.com/repos/mesos/spark-ec2/pulls/comments/23179044","id":23179044,"diff_hunk":"@@ -19,11 +19,13 @@ SHORT_HOSTNAME=`hostname`\n PRIVATE_IP=`wget -q -O - http://169.254.169.254/latest/meta-data/local-ipv4`\n \n # do changes only if short hostname does not resolve\n-if [ ! ping -c 1 -q \"${SHORT_HOSTNAME}\" > /dev/null 2>&1 ]; then\n-    echo -e \"\\n ${PRIVATE_IP} ${SHORT_HOSTNAME}\\n\" >> /etc/hosts\n+ping -c 1 -q \"${SHORT_HOSTNAME}\" > /dev/null 2>&1\n+if [ ! $? -eq 0  ]; then\n+    echo -e \"\\n# fixed by resolve-hostname.sh \\n${PRIVATE_IP} ${SHORT_HOSTNAME}\\n\" >> /etc/hosts\n \n     # let's make sure that it got fixed\n-    if [ ! ping -c 1 -q \"${SHORT_HOSTNAME}\" > /dev/null 2>&1 ]; then\n+    ping -c 1 -q \"${SHORT_HOSTNAME}\" > /dev/null 2>&1\n+    if [ ! $? -eq 0 ]; then","path":"resolve-hostname.sh","position":13,"original_position":13,"commit_id":"95c693c5e42a899ecbbe1d5d496e45afa9b27cd6","original_commit_id":"95c693c5e42a899ecbbe1d5d496e45afa9b27cd6","user":{"login":"shivaram","id":143893,"avatar_url":"https://avatars.githubusercontent.com/u/143893?v=3","gravatar_id":"","url":"https://api.github.com/users/shivaram","html_url":"https://github.com/shivaram","followers_url":"https://api.github.com/users/shivaram/followers","following_url":"https://api.github.com/users/shivaram/following{/other_user}","gists_url":"https://api.github.com/users/shivaram/gists{/gist_id}","starred_url":"https://api.github.com/users/shivaram/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shivaram/subscriptions","organizations_url":"https://api.github.com/users/shivaram/orgs","repos_url":"https://api.github.com/users/shivaram/repos","events_url":"https://api.github.com/users/shivaram/events{/privacy}","received_events_url":"https://api.github.com/users/shivaram/received_events","type":"User","site_admin":false},"body":"minor comment -- can we use `-ne` here instead of `! -eq` ?","created_at":"2015-01-19T18:50:11Z","updated_at":"2015-01-19T18:50:11Z","html_url":"https://github.com/mesos/spark-ec2/pull/92#discussion_r23179044","pull_request_url":"https://api.github.com/repos/mesos/spark-ec2/pulls/92","_links":{"self":{"href":"https://api.github.com/repos/mesos/spark-ec2/pulls/comments/23179044"},"html":{"href":"https://github.com/mesos/spark-ec2/pull/92#discussion_r23179044"},"pull_request":{"href":"https://api.github.com/repos/mesos/spark-ec2/pulls/92"}}},"pull_request":{"url":"https://api.github.com/repos/mesos/spark-ec2/pulls/92","id":27620736,"html_url":"https://github.com/mesos/spark-ec2/pull/92","diff_url":"https://github.com/mesos/spark-ec2/pull/92.diff","patch_url":"https://github.com/mesos/spark-ec2/pull/92.patch","issue_url":"https://api.github.com/repos/mesos/spark-ec2/issues/92","number":92,"state":"open","locked":false,"title":" fixed another bug in the bug fix for SPARK-5246","user":{"login":"voukka","id":207265,"avatar_url":"https://avatars.githubusercontent.com/u/207265?v=3","gravatar_id":"","url":"https://api.github.com/users/voukka","html_url":"https://github.com/voukka","followers_url":"https://api.github.com/users/voukka/followers","following_url":"https://api.github.com/users/voukka/following{/other_user}","gists_url":"https://api.github.com/users/voukka/gists{/gist_id}","starred_url":"https://api.github.com/users/voukka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/voukka/subscriptions","organizations_url":"https://api.github.com/users/voukka/orgs","repos_url":"https://api.github.com/users/voukka/repos","events_url":"https://api.github.com/users/voukka/events{/privacy}","received_events_url":"https://api.github.com/users/voukka/received_events","type":"User","site_admin":false},"body":"I have tested this fix in cluster running the script manually and it works. \r\n\r\n","created_at":"2015-01-19T16:57:24Z","updated_at":"2015-01-19T18:50:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6aecd40998393ce6948cc3bb2d6abc85a07c91e4","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mesos/spark-ec2/pulls/92/commits","review_comments_url":"https://api.github.com/repos/mesos/spark-ec2/pulls/92/comments","review_comment_url":"https://api.github.com/repos/mesos/spark-ec2/pulls/comments/{number}","comments_url":"https://api.github.com/repos/mesos/spark-ec2/issues/92/comments","statuses_url":"https://api.github.com/repos/mesos/spark-ec2/statuses/95c693c5e42a899ecbbe1d5d496e45afa9b27cd6","head":{"label":"voukka:SPARK-5246_resolve_hostname_2","ref":"SPARK-5246_resolve_hostname_2","sha":"95c693c5e42a899ecbbe1d5d496e45afa9b27cd6","user":{"login":"voukka","id":207265,"avatar_url":"https://avatars.githubusercontent.com/u/207265?v=3","gravatar_id":"","url":"https://api.github.com/users/voukka","html_url":"https://github.com/voukka","followers_url":"https://api.github.com/users/voukka/followers","following_url":"https://api.github.com/users/voukka/following{/other_user}","gists_url":"https://api.github.com/users/voukka/gists{/gist_id}","starred_url":"https://api.github.com/users/voukka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/voukka/subscriptions","organizations_url":"https://api.github.com/users/voukka/orgs","repos_url":"https://api.github.com/users/voukka/repos","events_url":"https://api.github.com/users/voukka/events{/privacy}","received_events_url":"https://api.github.com/users/voukka/received_events","type":"User","site_admin":false},"repo":{"id":29236685,"name":"spark-ec2","full_name":"voukka/spark-ec2","owner":{"login":"voukka","id":207265,"avatar_url":"https://avatars.githubusercontent.com/u/207265?v=3","gravatar_id":"","url":"https://api.github.com/users/voukka","html_url":"https://github.com/voukka","followers_url":"https://api.github.com/users/voukka/followers","following_url":"https://api.github.com/users/voukka/following{/other_user}","gists_url":"https://api.github.com/users/voukka/gists{/gist_id}","starred_url":"https://api.github.com/users/voukka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/voukka/subscriptions","organizations_url":"https://api.github.com/users/voukka/orgs","repos_url":"https://api.github.com/users/voukka/repos","events_url":"https://api.github.com/users/voukka/events{/privacy}","received_events_url":"https://api.github.com/users/voukka/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/voukka/spark-ec2","description":"Scripts used to setup a Spark cluster on EC2","fork":true,"url":"https://api.github.com/repos/voukka/spark-ec2","forks_url":"https://api.github.com/repos/voukka/spark-ec2/forks","keys_url":"https://api.github.com/repos/voukka/spark-ec2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/voukka/spark-ec2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/voukka/spark-ec2/teams","hooks_url":"https://api.github.com/repos/voukka/spark-ec2/hooks","issue_events_url":"https://api.github.com/repos/voukka/spark-ec2/issues/events{/number}","events_url":"https://api.github.com/repos/voukka/spark-ec2/events","assignees_url":"https://api.github.com/repos/voukka/spark-ec2/assignees{/user}","branches_url":"https://api.github.com/repos/voukka/spark-ec2/branches{/branch}","tags_url":"https://api.github.com/repos/voukka/spark-ec2/tags","blobs_url":"https://api.github.com/repos/voukka/spark-ec2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/voukka/spark-ec2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/voukka/spark-ec2/git/refs{/sha}","trees_url":"https://api.github.com/repos/voukka/spark-ec2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/voukka/spark-ec2/statuses/{sha}","languages_url":"https://api.github.com/repos/voukka/spark-ec2/languages","stargazers_url":"https://api.github.com/repos/voukka/spark-ec2/stargazers","contributors_url":"https://api.github.com/repos/voukka/spark-ec2/contributors","subscribers_url":"https://api.github.com/repos/voukka/spark-ec2/subscribers","subscription_url":"https://api.github.com/repos/voukka/spark-ec2/subscription","commits_url":"https://api.github.com/repos/voukka/spark-ec2/commits{/sha}","git_commits_url":"https://api.github.com/repos/voukka/spark-ec2/git/commits{/sha}","comments_url":"https://api.github.com/repos/voukka/spark-ec2/comments{/number}","issue_comment_url":"https://api.github.com/repos/voukka/spark-ec2/issues/comments/{number}","contents_url":"https://api.github.com/repos/voukka/spark-ec2/contents/{+path}","compare_url":"https://api.github.com/repos/voukka/spark-ec2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/voukka/spark-ec2/merges","archive_url":"https://api.github.com/repos/voukka/spark-ec2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/voukka/spark-ec2/downloads","issues_url":"https://api.github.com/repos/voukka/spark-ec2/issues{/number}","pulls_url":"https://api.github.com/repos/voukka/spark-ec2/pulls{/number}","milestones_url":"https://api.github.com/repos/voukka/spark-ec2/milestones{/number}","notifications_url":"https://api.github.com/repos/voukka/spark-ec2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/voukka/spark-ec2/labels{/name}","releases_url":"https://api.github.com/repos/voukka/spark-ec2/releases{/id}","created_at":"2015-01-14T09:22:20Z","updated_at":"2015-01-19T16:44:28Z","pushed_at":"2015-01-19T16:54:53Z","git_url":"git://github.com/voukka/spark-ec2.git","ssh_url":"git@github.com:voukka/spark-ec2.git","clone_url":"https://github.com/voukka/spark-ec2.git","svn_url":"https://github.com/voukka/spark-ec2","homepage":null,"size":373,"stargazers_count":0,"watchers_count":0,"language":"Shell","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":"branch-1.3"}},"base":{"label":"mesos:branch-1.3","ref":"branch-1.3","sha":"1320a4683d1371dded13b5eb711ea19571912083","user":{"login":"mesos","id":229272,"avatar_url":"https://avatars.githubusercontent.com/u/229272?v=3","gravatar_id":"","url":"https://api.github.com/users/mesos","html_url":"https://github.com/mesos","followers_url":"https://api.github.com/users/mesos/followers","following_url":"https://api.github.com/users/mesos/following{/other_user}","gists_url":"https://api.github.com/users/mesos/gists{/gist_id}","starred_url":"https://api.github.com/users/mesos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mesos/subscriptions","organizations_url":"https://api.github.com/users/mesos/orgs","repos_url":"https://api.github.com/users/mesos/repos","events_url":"https://api.github.com/users/mesos/events{/privacy}","received_events_url":"https://api.github.com/users/mesos/received_events","type":"Organization","site_admin":false},"repo":{"id":8257251,"name":"spark-ec2","full_name":"mesos/spark-ec2","owner":{"login":"mesos","id":229272,"avatar_url":"https://avatars.githubusercontent.com/u/229272?v=3","gravatar_id":"","url":"https://api.github.com/users/mesos","html_url":"https://github.com/mesos","followers_url":"https://api.github.com/users/mesos/followers","following_url":"https://api.github.com/users/mesos/following{/other_user}","gists_url":"https://api.github.com/users/mesos/gists{/gist_id}","starred_url":"https://api.github.com/users/mesos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mesos/subscriptions","organizations_url":"https://api.github.com/users/mesos/orgs","repos_url":"https://api.github.com/users/mesos/repos","events_url":"https://api.github.com/users/mesos/events{/privacy}","received_events_url":"https://api.github.com/users/mesos/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mesos/spark-ec2","description":"Scripts used to setup a Spark cluster on EC2","fork":true,"url":"https://api.github.com/repos/mesos/spark-ec2","forks_url":"https://api.github.com/repos/mesos/spark-ec2/forks","keys_url":"https://api.github.com/repos/mesos/spark-ec2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mesos/spark-ec2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mesos/spark-ec2/teams","hooks_url":"https://api.github.com/repos/mesos/spark-ec2/hooks","issue_events_url":"https://api.github.com/repos/mesos/spark-ec2/issues/events{/number}","events_url":"https://api.github.com/repos/mesos/spark-ec2/events","assignees_url":"https://api.github.com/repos/mesos/spark-ec2/assignees{/user}","branches_url":"https://api.github.com/repos/mesos/spark-ec2/branches{/branch}","tags_url":"https://api.github.com/repos/mesos/spark-ec2/tags","blobs_url":"https://api.github.com/repos/mesos/spark-ec2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mesos/spark-ec2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mesos/spark-ec2/git/refs{/sha}","trees_url":"https://api.github.com/repos/mesos/spark-ec2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mesos/spark-ec2/statuses/{sha}","languages_url":"https://api.github.com/repos/mesos/spark-ec2/languages","stargazers_url":"https://api.github.com/repos/mesos/spark-ec2/stargazers","contributors_url":"https://api.github.com/repos/mesos/spark-ec2/contributors","subscribers_url":"https://api.github.com/repos/mesos/spark-ec2/subscribers","subscription_url":"https://api.github.com/repos/mesos/spark-ec2/subscription","commits_url":"https://api.github.com/repos/mesos/spark-ec2/commits{/sha}","git_commits_url":"https://api.github.com/repos/mesos/spark-ec2/git/commits{/sha}","comments_url":"https://api.github.com/repos/mesos/spark-ec2/comments{/number}","issue_comment_url":"https://api.github.com/repos/mesos/spark-ec2/issues/comments/{number}","contents_url":"https://api.github.com/repos/mesos/spark-ec2/contents/{+path}","compare_url":"https://api.github.com/repos/mesos/spark-ec2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mesos/spark-ec2/merges","archive_url":"https://api.github.com/repos/mesos/spark-ec2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mesos/spark-ec2/downloads","issues_url":"https://api.github.com/repos/mesos/spark-ec2/issues{/number}","pulls_url":"https://api.github.com/repos/mesos/spark-ec2/pulls{/number}","milestones_url":"https://api.github.com/repos/mesos/spark-ec2/milestones{/number}","notifications_url":"https://api.github.com/repos/mesos/spark-ec2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mesos/spark-ec2/labels{/name}","releases_url":"https://api.github.com/repos/mesos/spark-ec2/releases{/id}","created_at":"2013-02-17T21:51:50Z","updated_at":"2015-01-18T19:25:06Z","pushed_at":"2015-01-18T19:25:06Z","git_url":"git://github.com/mesos/spark-ec2.git","ssh_url":"git@github.com:mesos/spark-ec2.git","clone_url":"https://github.com/mesos/spark-ec2.git","svn_url":"https://github.com/mesos/spark-ec2","homepage":null,"size":1049,"stargazers_count":40,"watchers_count":40,"language":"Shell","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":76,"mirror_url":null,"open_issues_count":4,"forks":76,"open_issues":4,"watchers":40,"default_branch":"branch-1.3"}},"_links":{"self":{"href":"https://api.github.com/repos/mesos/spark-ec2/pulls/92"},"html":{"href":"https://github.com/mesos/spark-ec2/pull/92"},"issue":{"href":"https://api.github.com/repos/mesos/spark-ec2/issues/92"},"comments":{"href":"https://api.github.com/repos/mesos/spark-ec2/issues/92/comments"},"review_comments":{"href":"https://api.github.com/repos/mesos/spark-ec2/pulls/92/comments"},"review_comment":{"href":"https://api.github.com/repos/mesos/spark-ec2/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/mesos/spark-ec2/pulls/92/commits"},"statuses":{"href":"https://api.github.com/repos/mesos/spark-ec2/statuses/95c693c5e42a899ecbbe1d5d496e45afa9b27cd6"}}}}