{"action":"created","comment":{"url":"https://api.github.com/repos/skyarch-networks/skyhopper/pulls/comments/38069636","id":38069636,"diff_hunk":"@@ -150,90 +148,33 @@ def initialize(infra, physical_id)\n   end\n \n   def fqdn\n-    @fqdn ||= @infra.ec2.instances[@physical_id].public_dns_name\n-  end\n-\n-  def ip_addr\n-    @ip_addr ||= @infra.ec2.instances[@physical_id].ip_address\n+    @fqdn ||= @infra.instance(@physical_id).public_dns_name\n   end\n \n   def url\n     \"https://#{fqdn}/organizations/#{Org}\"\n   end\n \n-  def wait_init_ec2\n-    loop do\n-      begin\n-        exec_ssh(timeout: 5){}\n-      rescue\n-        sleep 10\n-        next\n-      else\n-        break\n-      end\n-    end\n-  end\n-\n-  def fix_hostname\n-    exec_ssh do |ssh|\n-      ssh.shell do |sh|\n-        sh.execute! \"sudo hostname #{fqdn}\"\n-        sh.execute! %!sudo sed -i -E \"s/^HOSTNAME=.+$/HOSTNAME=#{fqdn}/g\" /etc/sysconfig/network!\n-        sh.execute! 'sudo service network restart'\n-        sh.close!\n-        sh.execute! 'exit'\n-      end\n-    end\n-  end\n-\n-  def install_chef\n-    log = -> (process) { process.on_output{|pr, data| Rails.logger.debug(\"sh out > #{data}\")} }\n-\n-    exec_ssh do |ssh|\n-      ssh.shell do |sh|\n-        sh.execute! 'cd /tmp/'\n-        sh.execute! \"sudo rpm -Uvh #{PackageURL}\"\n-        sh.execute! \"sudo dd if=/dev/zero of=/swap bs=1M count=600\"\n-        sh.execute! \"sudo mkswap /swap\"\n-        sh.execute! \"sudo swapon /swap\"\n-        sh.execute! 'sudo chef-server-ctl reconfigure'\n-        sh.execute! 'sudo chef-server-ctl start'\n-        Rails.logger.debug(\"exec user-create\")\n-        sh.execute! \"sudo chef-server-ctl user-create #{User} #{FullName} #{EMail} #{PassWord} --filename #{User}.pem\", &log\n-        Rails.logger.debug(\"exec org-create\")\n-        sh.execute! \"sudo chef-server-ctl org-create #{Org} #{FullOrg} --association_user #{User} --filename #{Org}.pem\", &log\n-        Rails.logger.debug(\"done\")\n-        sh.close!\n-        sh.execute! 'exit'\n-      end\n-    end\n-  end\n-\n   def init_knife_rb\n-    exec_ssh do |ssh|\n-      ssh.shell do |sh|\n-        sh.execute! 'cd /tmp/'\n-        sh.execute! \"sudo cp /var/opt/opscode/nginx/ca/#{fqdn}.crt ./\"\n-\n-        sh.close!\n-        sh.execute! 'exit'\n-      end\n-    end\n+    stack = Stack.new(@infra)\n+    output = JSON.parse(stack.outputs.first.output_value)\n \n     # TODO: 直接~/.chef/下に鍵を作る path = Pathname.new(File.expand_path('~/.chef/'))\n     #       開発環境で上書きされないようにするのはどうする?\n     path = Rails.root.join('tmp', 'chef')\n     FileUtils.mkdir_p(path) unless Dir.exist?(path)\n \n-    exec_scp(\"/tmp/#{User}.pem\", path)\n-    File.chmod(0600, path.join(\"#{User}.pem\"))\n+    user_pem = path.join(\"#{User}.pem\")\n+    File.write(user_pem, output[UserPemID])\n+    File.chmod(0600, user_pem)\n \n-    exec_scp(\"/tmp/#{Org}.pem\", path)\n-    File.chmod(0600, path.join(\"#{Org}.pem\"))\n+    org_pem = path.join(\"#{Org}.pem\")","path":"app/models/chef_server/deployment.rb","position":216,"original_position":216,"commit_id":"9fc4a50f9363eeaaee216e375f5924110840b7d6","original_commit_id":"9fc4a50f9363eeaaee216e375f5924110840b7d6","user":{"login":"skyarch-networks","id":10970571,"avatar_url":"https://avatars.githubusercontent.com/u/10970571?v=3","gravatar_id":"","url":"https://api.github.com/users/skyarch-networks","html_url":"https://github.com/skyarch-networks","followers_url":"https://api.github.com/users/skyarch-networks/followers","following_url":"https://api.github.com/users/skyarch-networks/following{/other_user}","gists_url":"https://api.github.com/users/skyarch-networks/gists{/gist_id}","starred_url":"https://api.github.com/users/skyarch-networks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skyarch-networks/subscriptions","organizations_url":"https://api.github.com/users/skyarch-networks/orgs","repos_url":"https://api.github.com/users/skyarch-networks/repos","events_url":"https://api.github.com/users/skyarch-networks/events{/privacy}","received_events_url":"https://api.github.com/users/skyarch-networks/received_events","type":"User","site_admin":false},"body":"__[reek]__\n* [FeatureEnvy] refers to path more than self","created_at":"2015-08-27T07:44:41Z","updated_at":"2015-08-27T07:44:41Z","html_url":"https://github.com/skyarch-networks/skyhopper/pull/23#discussion_r38069636","pull_request_url":"https://api.github.com/repos/skyarch-networks/skyhopper/pulls/23","_links":{"self":{"href":"https://api.github.com/repos/skyarch-networks/skyhopper/pulls/comments/38069636"},"html":{"href":"https://github.com/skyarch-networks/skyhopper/pull/23#discussion_r38069636"},"pull_request":{"href":"https://api.github.com/repos/skyarch-networks/skyhopper/pulls/23"}}},"pull_request":{"url":"https://api.github.com/repos/skyarch-networks/skyhopper/pulls/23","id":43487407,"html_url":"https://github.com/skyarch-networks/skyhopper/pull/23","diff_url":"https://github.com/skyarch-networks/skyhopper/pull/23.diff","patch_url":"https://github.com/skyarch-networks/skyhopper/pull/23.patch","issue_url":"https://api.github.com/repos/skyarch-networks/skyhopper/issues/23","number":23,"state":"closed","locked":false,"title":"Jshint en fix","user":{"login":"Joeper214","id":2352389,"avatar_url":"https://avatars.githubusercontent.com/u/2352389?v=3","gravatar_id":"","url":"https://api.github.com/users/Joeper214","html_url":"https://github.com/Joeper214","followers_url":"https://api.github.com/users/Joeper214/followers","following_url":"https://api.github.com/users/Joeper214/following{/other_user}","gists_url":"https://api.github.com/users/Joeper214/gists{/gist_id}","starred_url":"https://api.github.com/users/Joeper214/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Joeper214/subscriptions","organizations_url":"https://api.github.com/users/Joeper214/orgs","repos_url":"https://api.github.com/users/Joeper214/repos","events_url":"https://api.github.com/users/Joeper214/events{/privacy}","received_events_url":"https://api.github.com/users/Joeper214/received_events","type":"User","site_admin":false},"body":"### JSHINT and En.yml fix\r\n\r\nhttps://www.sideci.com/github_repositories/31754199/issues/pull_request/21/all/c503a251#jshint","created_at":"2015-08-27T07:36:14Z","updated_at":"2015-08-27T07:44:41Z","closed_at":"2015-08-27T07:37:55Z","merged_at":null,"merge_commit_sha":"a4c9915c2f1c69ca34a7ce76310107b9ccf213e5","assignee":{"login":"pocke","id":4361134,"avatar_url":"https://avatars.githubusercontent.com/u/4361134?v=3","gravatar_id":"","url":"https://api.github.com/users/pocke","html_url":"https://github.com/pocke","followers_url":"https://api.github.com/users/pocke/followers","following_url":"https://api.github.com/users/pocke/following{/other_user}","gists_url":"https://api.github.com/users/pocke/gists{/gist_id}","starred_url":"https://api.github.com/users/pocke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pocke/subscriptions","organizations_url":"https://api.github.com/users/pocke/orgs","repos_url":"https://api.github.com/users/pocke/repos","events_url":"https://api.github.com/users/pocke/events{/privacy}","received_events_url":"https://api.github.com/users/pocke/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/skyarch-networks/skyhopper/pulls/23/commits","review_comments_url":"https://api.github.com/repos/skyarch-networks/skyhopper/pulls/23/comments","review_comment_url":"https://api.github.com/repos/skyarch-networks/skyhopper/pulls/comments{/number}","comments_url":"https://api.github.com/repos/skyarch-networks/skyhopper/issues/23/comments","statuses_url":"https://api.github.com/repos/skyarch-networks/skyhopper/statuses/9fc4a50f9363eeaaee216e375f5924110840b7d6","head":{"label":"skyarch-networks:jshint-en-fix","ref":"jshint-en-fix","sha":"9fc4a50f9363eeaaee216e375f5924110840b7d6","user":{"login":"skyarch-networks","id":10970571,"avatar_url":"https://avatars.githubusercontent.com/u/10970571?v=3","gravatar_id":"","url":"https://api.github.com/users/skyarch-networks","html_url":"https://github.com/skyarch-networks","followers_url":"https://api.github.com/users/skyarch-networks/followers","following_url":"https://api.github.com/users/skyarch-networks/following{/other_user}","gists_url":"https://api.github.com/users/skyarch-networks/gists{/gist_id}","starred_url":"https://api.github.com/users/skyarch-networks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skyarch-networks/subscriptions","organizations_url":"https://api.github.com/users/skyarch-networks/orgs","repos_url":"https://api.github.com/users/skyarch-networks/repos","events_url":"https://api.github.com/users/skyarch-networks/events{/privacy}","received_events_url":"https://api.github.com/users/skyarch-networks/received_events","type":"User","site_admin":false},"repo":{"id":31754199,"name":"skyhopper","full_name":"skyarch-networks/skyhopper","owner":{"login":"skyarch-networks","id":10970571,"avatar_url":"https://avatars.githubusercontent.com/u/10970571?v=3","gravatar_id":"","url":"https://api.github.com/users/skyarch-networks","html_url":"https://github.com/skyarch-networks","followers_url":"https://api.github.com/users/skyarch-networks/followers","following_url":"https://api.github.com/users/skyarch-networks/following{/other_user}","gists_url":"https://api.github.com/users/skyarch-networks/gists{/gist_id}","starred_url":"https://api.github.com/users/skyarch-networks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skyarch-networks/subscriptions","organizations_url":"https://api.github.com/users/skyarch-networks/orgs","repos_url":"https://api.github.com/users/skyarch-networks/repos","events_url":"https://api.github.com/users/skyarch-networks/events{/privacy}","received_events_url":"https://api.github.com/users/skyarch-networks/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/skyarch-networks/skyhopper","description":"システム自動構築ツール","fork":false,"url":"https://api.github.com/repos/skyarch-networks/skyhopper","forks_url":"https://api.github.com/repos/skyarch-networks/skyhopper/forks","keys_url":"https://api.github.com/repos/skyarch-networks/skyhopper/keys{/key_id}","collaborators_url":"https://api.github.com/repos/skyarch-networks/skyhopper/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/skyarch-networks/skyhopper/teams","hooks_url":"https://api.github.com/repos/skyarch-networks/skyhopper/hooks","issue_events_url":"https://api.github.com/repos/skyarch-networks/skyhopper/issues/events{/number}","events_url":"https://api.github.com/repos/skyarch-networks/skyhopper/events","assignees_url":"https://api.github.com/repos/skyarch-networks/skyhopper/assignees{/user}","branches_url":"https://api.github.com/repos/skyarch-networks/skyhopper/branches{/branch}","tags_url":"https://api.github.com/repos/skyarch-networks/skyhopper/tags","blobs_url":"https://api.github.com/repos/skyarch-networks/skyhopper/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/skyarch-networks/skyhopper/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/skyarch-networks/skyhopper/git/refs{/sha}","trees_url":"https://api.github.com/repos/skyarch-networks/skyhopper/git/trees{/sha}","statuses_url":"https://api.github.com/repos/skyarch-networks/skyhopper/statuses/{sha}","languages_url":"https://api.github.com/repos/skyarch-networks/skyhopper/languages","stargazers_url":"https://api.github.com/repos/skyarch-networks/skyhopper/stargazers","contributors_url":"https://api.github.com/repos/skyarch-networks/skyhopper/contributors","subscribers_url":"https://api.github.com/repos/skyarch-networks/skyhopper/subscribers","subscription_url":"https://api.github.com/repos/skyarch-networks/skyhopper/subscription","commits_url":"https://api.github.com/repos/skyarch-networks/skyhopper/commits{/sha}","git_commits_url":"https://api.github.com/repos/skyarch-networks/skyhopper/git/commits{/sha}","comments_url":"https://api.github.com/repos/skyarch-networks/skyhopper/comments{/number}","issue_comment_url":"https://api.github.com/repos/skyarch-networks/skyhopper/issues/comments{/number}","contents_url":"https://api.github.com/repos/skyarch-networks/skyhopper/contents/{+path}","compare_url":"https://api.github.com/repos/skyarch-networks/skyhopper/compare/{base}...{head}","merges_url":"https://api.github.com/repos/skyarch-networks/skyhopper/merges","archive_url":"https://api.github.com/repos/skyarch-networks/skyhopper/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/skyarch-networks/skyhopper/downloads","issues_url":"https://api.github.com/repos/skyarch-networks/skyhopper/issues{/number}","pulls_url":"https://api.github.com/repos/skyarch-networks/skyhopper/pulls{/number}","milestones_url":"https://api.github.com/repos/skyarch-networks/skyhopper/milestones{/number}","notifications_url":"https://api.github.com/repos/skyarch-networks/skyhopper/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/skyarch-networks/skyhopper/labels{/name}","releases_url":"https://api.github.com/repos/skyarch-networks/skyhopper/releases{/id}","created_at":"2015-03-06T05:30:44Z","updated_at":"2015-08-03T06:38:16Z","pushed_at":"2015-08-27T07:38:37Z","git_url":"git://github.com/skyarch-networks/skyhopper.git","ssh_url":"git@github.com:skyarch-networks/skyhopper.git","clone_url":"https://github.com/skyarch-networks/skyhopper.git","svn_url":"https://github.com/skyarch-networks/skyhopper","homepage":"","size":6556,"stargazers_count":14,"watchers_count":14,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":4,"forks":1,"open_issues":4,"watchers":14,"default_branch":"master"}},"base":{"label":"skyarch-networks:master","ref":"master","sha":"35643ffb363de9c540a2b2fbd1c7e398528a1054","user":{"login":"skyarch-networks","id":10970571,"avatar_url":"https://avatars.githubusercontent.com/u/10970571?v=3","gravatar_id":"","url":"https://api.github.com/users/skyarch-networks","html_url":"https://github.com/skyarch-networks","followers_url":"https://api.github.com/users/skyarch-networks/followers","following_url":"https://api.github.com/users/skyarch-networks/following{/other_user}","gists_url":"https://api.github.com/users/skyarch-networks/gists{/gist_id}","starred_url":"https://api.github.com/users/skyarch-networks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skyarch-networks/subscriptions","organizations_url":"https://api.github.com/users/skyarch-networks/orgs","repos_url":"https://api.github.com/users/skyarch-networks/repos","events_url":"https://api.github.com/users/skyarch-networks/events{/privacy}","received_events_url":"https://api.github.com/users/skyarch-networks/received_events","type":"User","site_admin":false},"repo":{"id":31754199,"name":"skyhopper","full_name":"skyarch-networks/skyhopper","owner":{"login":"skyarch-networks","id":10970571,"avatar_url":"https://avatars.githubusercontent.com/u/10970571?v=3","gravatar_id":"","url":"https://api.github.com/users/skyarch-networks","html_url":"https://github.com/skyarch-networks","followers_url":"https://api.github.com/users/skyarch-networks/followers","following_url":"https://api.github.com/users/skyarch-networks/following{/other_user}","gists_url":"https://api.github.com/users/skyarch-networks/gists{/gist_id}","starred_url":"https://api.github.com/users/skyarch-networks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skyarch-networks/subscriptions","organizations_url":"https://api.github.com/users/skyarch-networks/orgs","repos_url":"https://api.github.com/users/skyarch-networks/repos","events_url":"https://api.github.com/users/skyarch-networks/events{/privacy}","received_events_url":"https://api.github.com/users/skyarch-networks/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/skyarch-networks/skyhopper","description":"システム自動構築ツール","fork":false,"url":"https://api.github.com/repos/skyarch-networks/skyhopper","forks_url":"https://api.github.com/repos/skyarch-networks/skyhopper/forks","keys_url":"https://api.github.com/repos/skyarch-networks/skyhopper/keys{/key_id}","collaborators_url":"https://api.github.com/repos/skyarch-networks/skyhopper/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/skyarch-networks/skyhopper/teams","hooks_url":"https://api.github.com/repos/skyarch-networks/skyhopper/hooks","issue_events_url":"https://api.github.com/repos/skyarch-networks/skyhopper/issues/events{/number}","events_url":"https://api.github.com/repos/skyarch-networks/skyhopper/events","assignees_url":"https://api.github.com/repos/skyarch-networks/skyhopper/assignees{/user}","branches_url":"https://api.github.com/repos/skyarch-networks/skyhopper/branches{/branch}","tags_url":"https://api.github.com/repos/skyarch-networks/skyhopper/tags","blobs_url":"https://api.github.com/repos/skyarch-networks/skyhopper/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/skyarch-networks/skyhopper/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/skyarch-networks/skyhopper/git/refs{/sha}","trees_url":"https://api.github.com/repos/skyarch-networks/skyhopper/git/trees{/sha}","statuses_url":"https://api.github.com/repos/skyarch-networks/skyhopper/statuses/{sha}","languages_url":"https://api.github.com/repos/skyarch-networks/skyhopper/languages","stargazers_url":"https://api.github.com/repos/skyarch-networks/skyhopper/stargazers","contributors_url":"https://api.github.com/repos/skyarch-networks/skyhopper/contributors","subscribers_url":"https://api.github.com/repos/skyarch-networks/skyhopper/subscribers","subscription_url":"https://api.github.com/repos/skyarch-networks/skyhopper/subscription","commits_url":"https://api.github.com/repos/skyarch-networks/skyhopper/commits{/sha}","git_commits_url":"https://api.github.com/repos/skyarch-networks/skyhopper/git/commits{/sha}","comments_url":"https://api.github.com/repos/skyarch-networks/skyhopper/comments{/number}","issue_comment_url":"https://api.github.com/repos/skyarch-networks/skyhopper/issues/comments{/number}","contents_url":"https://api.github.com/repos/skyarch-networks/skyhopper/contents/{+path}","compare_url":"https://api.github.com/repos/skyarch-networks/skyhopper/compare/{base}...{head}","merges_url":"https://api.github.com/repos/skyarch-networks/skyhopper/merges","archive_url":"https://api.github.com/repos/skyarch-networks/skyhopper/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/skyarch-networks/skyhopper/downloads","issues_url":"https://api.github.com/repos/skyarch-networks/skyhopper/issues{/number}","pulls_url":"https://api.github.com/repos/skyarch-networks/skyhopper/pulls{/number}","milestones_url":"https://api.github.com/repos/skyarch-networks/skyhopper/milestones{/number}","notifications_url":"https://api.github.com/repos/skyarch-networks/skyhopper/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/skyarch-networks/skyhopper/labels{/name}","releases_url":"https://api.github.com/repos/skyarch-networks/skyhopper/releases{/id}","created_at":"2015-03-06T05:30:44Z","updated_at":"2015-08-03T06:38:16Z","pushed_at":"2015-08-27T07:38:37Z","git_url":"git://github.com/skyarch-networks/skyhopper.git","ssh_url":"git@github.com:skyarch-networks/skyhopper.git","clone_url":"https://github.com/skyarch-networks/skyhopper.git","svn_url":"https://github.com/skyarch-networks/skyhopper","homepage":"","size":6556,"stargazers_count":14,"watchers_count":14,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":4,"forks":1,"open_issues":4,"watchers":14,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/skyarch-networks/skyhopper/pulls/23"},"html":{"href":"https://github.com/skyarch-networks/skyhopper/pull/23"},"issue":{"href":"https://api.github.com/repos/skyarch-networks/skyhopper/issues/23"},"comments":{"href":"https://api.github.com/repos/skyarch-networks/skyhopper/issues/23/comments"},"review_comments":{"href":"https://api.github.com/repos/skyarch-networks/skyhopper/pulls/23/comments"},"review_comment":{"href":"https://api.github.com/repos/skyarch-networks/skyhopper/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/skyarch-networks/skyhopper/pulls/23/commits"},"statuses":{"href":"https://api.github.com/repos/skyarch-networks/skyhopper/statuses/9fc4a50f9363eeaaee216e375f5924110840b7d6"}}}}