{"action":"created","comment":{"url":"https://api.github.com/repos/InfraSIM/infrasim-compute/pulls/comments/83591057","pull_request_review_id":4424428,"id":83591057,"diff_hunk":"@@ -0,0 +1,79 @@\n+#!/usr/bin/env python\n+\"\"\"\n+*********************************************************\n+Copyright @ 2015 EMC Corporation All Rights Reserved\n+*********************************************************\n+\"\"\"\n+# -*- coding: utf-8 -*-\n+\n+\"\"\"\n+this script is used to install the necessary packages before starting infrasim-compute\n+the packages includes:\n+    ipmitool libssh-dev libpython-dev libffi-dev libyaml-dev\n+    infrasim-qemu\n+    infrasim-openipmi\n+besides, seabios binary file is also downloaded into expected folder\n+\"\"\"\n+\n+import requests\n+import shutil\n+import os\n+from infrasim import run_command\n+\n+BASE_URL = \"https://api.bintray.com/packages/infrasim/\"\n+\n+\n+def install_official_packages():\n+    run_command(\"apt-get install -y socat ipmitool libssh-dev libffi-dev libyaml-dev\")\n+\n+\n+def install_bintray_packages(repo, package):\n+    print \"downloading \" + package + \"...\"\n+    download_link = BASE_URL + repo + \"/\" + package + \"/files\"\n+    response = requests.get(download_link)\n+    data = response.json()\n+    latest_time = data[0][\"created\"]\n+    path = \"\"\n+    file_name = \"\"\n+    for item in data:\n+        if item[\"created\"] >= latest_time:\n+            latest_time = item[\"created\"]\n+            path = item[\"path\"]\n+            file_name = item[\"name\"]\n+    response = requests.get(\"https://dl.bintray.com/infrasim/\" + repo + \"/\" + path)\n+    if package is \"Seabios\":\n+        file_name = os.path.join(\"/usr/local/share/qemu/\", \"bios-256k.bin\")\n+    else:\n+        file_name = \"/tmp/\" + file_name\n+    with open(file_name, \"wb\") as f:\n+        for chunk in response.iter_content(8192):\n+            f.write(chunk)\n+    if package is not \"Seabios\":\n+        print \"installing \" + package + \"...\"\n+        run_command(\"dpkg -i \" + file_name)\n+\n+\n+def copy_data_to_workspace():\n+    dst = \"{}/.infrasim/data/\".format(os.environ[\"HOME\"])\n+    if os.path.exists(dst):\n+        shutil.rmtree(dst)\n+    shutil.copytree(\"/usr/local/infrasim/data/\", dst)\n+\n+\n+def create_bridge_conf_link():\n+    if not os.path.exists(\"/usr/local/etc/qemu/bridge.conf\"):\n+        bridge_conf_dir = \"/usr/local/etc/qemu\"\n+        if not os.path.exists(bridge_conf_dir):\n+            os.makedirs(bridge_conf_dir)\n+            os.symlink(\"/etc/qemu/bridge.conf\", \"/usr/local/etc/qemu/bridge.conf\")","path":"infrasim/package_install.py","position":68,"original_position":68,"commit_id":"42e14b9bb543939e9ab9a775c20f4a9d39c3216b","original_commit_id":"42e14b9bb543939e9ab9a775c20f4a9d39c3216b","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"line too long (82 > 79 characters)","created_at":"2016-10-17T07:51:31Z","updated_at":"2016-10-17T07:51:31Z","html_url":"https://github.com/InfraSIM/infrasim-compute/pull/113#discussion_r83591057","pull_request_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/pulls/113","_links":{"self":{"href":"https://api.github.com/repos/InfraSIM/infrasim-compute/pulls/comments/83591057"},"html":{"href":"https://github.com/InfraSIM/infrasim-compute/pull/113#discussion_r83591057"},"pull_request":{"href":"https://api.github.com/repos/InfraSIM/infrasim-compute/pulls/113"}}},"pull_request":{"url":"https://api.github.com/repos/InfraSIM/infrasim-compute/pulls/113","id":89575417,"html_url":"https://github.com/InfraSIM/infrasim-compute/pull/113","diff_url":"https://github.com/InfraSIM/infrasim-compute/pull/113.diff","patch_url":"https://github.com/InfraSIM/infrasim-compute/pull/113.patch","issue_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/issues/113","number":113,"state":"open","locked":false,"title":"Rewrite package_install.sh to package_install.py","user":{"login":"XiaowenJiang","id":14223134,"avatar_url":"https://avatars.githubusercontent.com/u/14223134?v=3","gravatar_id":"","url":"https://api.github.com/users/XiaowenJiang","html_url":"https://github.com/XiaowenJiang","followers_url":"https://api.github.com/users/XiaowenJiang/followers","following_url":"https://api.github.com/users/XiaowenJiang/following{/other_user}","gists_url":"https://api.github.com/users/XiaowenJiang/gists{/gist_id}","starred_url":"https://api.github.com/users/XiaowenJiang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/XiaowenJiang/subscriptions","organizations_url":"https://api.github.com/users/XiaowenJiang/orgs","repos_url":"https://api.github.com/users/XiaowenJiang/repos","events_url":"https://api.github.com/users/XiaowenJiang/events{/privacy}","received_events_url":"https://api.github.com/users/XiaowenJiang/received_events","type":"User","site_admin":false},"body":"1) Retrieve latest deb/bin files from bintray.\r\n2) Put package_install.py into infrasim directory as a module.","created_at":"2016-10-17T07:51:27Z","updated_at":"2016-10-17T07:51:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f146a030321a51d4bf7fd0c3914371d75c285751","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/pulls/113/commits","review_comments_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/pulls/113/comments","review_comment_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/pulls/comments{/number}","comments_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/issues/113/comments","statuses_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/statuses/42e14b9bb543939e9ab9a775c20f4a9d39c3216b","head":{"label":"XiaowenJiang:rewrite","ref":"rewrite","sha":"42e14b9bb543939e9ab9a775c20f4a9d39c3216b","user":{"login":"XiaowenJiang","id":14223134,"avatar_url":"https://avatars.githubusercontent.com/u/14223134?v=3","gravatar_id":"","url":"https://api.github.com/users/XiaowenJiang","html_url":"https://github.com/XiaowenJiang","followers_url":"https://api.github.com/users/XiaowenJiang/followers","following_url":"https://api.github.com/users/XiaowenJiang/following{/other_user}","gists_url":"https://api.github.com/users/XiaowenJiang/gists{/gist_id}","starred_url":"https://api.github.com/users/XiaowenJiang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/XiaowenJiang/subscriptions","organizations_url":"https://api.github.com/users/XiaowenJiang/orgs","repos_url":"https://api.github.com/users/XiaowenJiang/repos","events_url":"https://api.github.com/users/XiaowenJiang/events{/privacy}","received_events_url":"https://api.github.com/users/XiaowenJiang/received_events","type":"User","site_admin":false},"repo":{"id":63658528,"name":"infrasim-compute","full_name":"XiaowenJiang/infrasim-compute","owner":{"login":"XiaowenJiang","id":14223134,"avatar_url":"https://avatars.githubusercontent.com/u/14223134?v=3","gravatar_id":"","url":"https://api.github.com/users/XiaowenJiang","html_url":"https://github.com/XiaowenJiang","followers_url":"https://api.github.com/users/XiaowenJiang/followers","following_url":"https://api.github.com/users/XiaowenJiang/following{/other_user}","gists_url":"https://api.github.com/users/XiaowenJiang/gists{/gist_id}","starred_url":"https://api.github.com/users/XiaowenJiang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/XiaowenJiang/subscriptions","organizations_url":"https://api.github.com/users/XiaowenJiang/orgs","repos_url":"https://api.github.com/users/XiaowenJiang/repos","events_url":"https://api.github.com/users/XiaowenJiang/events{/privacy}","received_events_url":"https://api.github.com/users/XiaowenJiang/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/XiaowenJiang/infrasim-compute","description":null,"fork":true,"url":"https://api.github.com/repos/XiaowenJiang/infrasim-compute","forks_url":"https://api.github.com/repos/XiaowenJiang/infrasim-compute/forks","keys_url":"https://api.github.com/repos/XiaowenJiang/infrasim-compute/keys{/key_id}","collaborators_url":"https://api.github.com/repos/XiaowenJiang/infrasim-compute/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/XiaowenJiang/infrasim-compute/teams","hooks_url":"https://api.github.com/repos/XiaowenJiang/infrasim-compute/hooks","issue_events_url":"https://api.github.com/repos/XiaowenJiang/infrasim-compute/issues/events{/number}","events_url":"https://api.github.com/repos/XiaowenJiang/infrasim-compute/events","assignees_url":"https://api.github.com/repos/XiaowenJiang/infrasim-compute/assignees{/user}","branches_url":"https://api.github.com/repos/XiaowenJiang/infrasim-compute/branches{/branch}","tags_url":"https://api.github.com/repos/XiaowenJiang/infrasim-compute/tags","blobs_url":"https://api.github.com/repos/XiaowenJiang/infrasim-compute/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/XiaowenJiang/infrasim-compute/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/XiaowenJiang/infrasim-compute/git/refs{/sha}","trees_url":"https://api.github.com/repos/XiaowenJiang/infrasim-compute/git/trees{/sha}","statuses_url":"https://api.github.com/repos/XiaowenJiang/infrasim-compute/statuses/{sha}","languages_url":"https://api.github.com/repos/XiaowenJiang/infrasim-compute/languages","stargazers_url":"https://api.github.com/repos/XiaowenJiang/infrasim-compute/stargazers","contributors_url":"https://api.github.com/repos/XiaowenJiang/infrasim-compute/contributors","subscribers_url":"https://api.github.com/repos/XiaowenJiang/infrasim-compute/subscribers","subscription_url":"https://api.github.com/repos/XiaowenJiang/infrasim-compute/subscription","commits_url":"https://api.github.com/repos/XiaowenJiang/infrasim-compute/commits{/sha}","git_commits_url":"https://api.github.com/repos/XiaowenJiang/infrasim-compute/git/commits{/sha}","comments_url":"https://api.github.com/repos/XiaowenJiang/infrasim-compute/comments{/number}","issue_comment_url":"https://api.github.com/repos/XiaowenJiang/infrasim-compute/issues/comments{/number}","contents_url":"https://api.github.com/repos/XiaowenJiang/infrasim-compute/contents/{+path}","compare_url":"https://api.github.com/repos/XiaowenJiang/infrasim-compute/compare/{base}...{head}","merges_url":"https://api.github.com/repos/XiaowenJiang/infrasim-compute/merges","archive_url":"https://api.github.com/repos/XiaowenJiang/infrasim-compute/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/XiaowenJiang/infrasim-compute/downloads","issues_url":"https://api.github.com/repos/XiaowenJiang/infrasim-compute/issues{/number}","pulls_url":"https://api.github.com/repos/XiaowenJiang/infrasim-compute/pulls{/number}","milestones_url":"https://api.github.com/repos/XiaowenJiang/infrasim-compute/milestones{/number}","notifications_url":"https://api.github.com/repos/XiaowenJiang/infrasim-compute/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/XiaowenJiang/infrasim-compute/labels{/name}","releases_url":"https://api.github.com/repos/XiaowenJiang/infrasim-compute/releases{/id}","deployments_url":"https://api.github.com/repos/XiaowenJiang/infrasim-compute/deployments","created_at":"2016-07-19T03:50:56Z","updated_at":"2016-07-19T03:50:58Z","pushed_at":"2016-10-17T07:50:35Z","git_url":"git://github.com/XiaowenJiang/infrasim-compute.git","ssh_url":"git@github.com:XiaowenJiang/infrasim-compute.git","clone_url":"https://github.com/XiaowenJiang/infrasim-compute.git","svn_url":"https://github.com/XiaowenJiang/infrasim-compute","homepage":null,"size":19407,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"InfraSIM:master","ref":"master","sha":"f7c65106438a7eebbe3230c5ed265ce890f9f15a","user":{"login":"InfraSIM","id":15829902,"avatar_url":"https://avatars.githubusercontent.com/u/15829902?v=3","gravatar_id":"","url":"https://api.github.com/users/InfraSIM","html_url":"https://github.com/InfraSIM","followers_url":"https://api.github.com/users/InfraSIM/followers","following_url":"https://api.github.com/users/InfraSIM/following{/other_user}","gists_url":"https://api.github.com/users/InfraSIM/gists{/gist_id}","starred_url":"https://api.github.com/users/InfraSIM/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/InfraSIM/subscriptions","organizations_url":"https://api.github.com/users/InfraSIM/orgs","repos_url":"https://api.github.com/users/InfraSIM/repos","events_url":"https://api.github.com/users/InfraSIM/events{/privacy}","received_events_url":"https://api.github.com/users/InfraSIM/received_events","type":"Organization","site_admin":false},"repo":{"id":60502320,"name":"infrasim-compute","full_name":"InfraSIM/infrasim-compute","owner":{"login":"InfraSIM","id":15829902,"avatar_url":"https://avatars.githubusercontent.com/u/15829902?v=3","gravatar_id":"","url":"https://api.github.com/users/InfraSIM","html_url":"https://github.com/InfraSIM","followers_url":"https://api.github.com/users/InfraSIM/followers","following_url":"https://api.github.com/users/InfraSIM/following{/other_user}","gists_url":"https://api.github.com/users/InfraSIM/gists{/gist_id}","starred_url":"https://api.github.com/users/InfraSIM/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/InfraSIM/subscriptions","organizations_url":"https://api.github.com/users/InfraSIM/orgs","repos_url":"https://api.github.com/users/InfraSIM/repos","events_url":"https://api.github.com/users/InfraSIM/events{/privacy}","received_events_url":"https://api.github.com/users/InfraSIM/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/InfraSIM/infrasim-compute","description":null,"fork":false,"url":"https://api.github.com/repos/InfraSIM/infrasim-compute","forks_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/forks","keys_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/keys{/key_id}","collaborators_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/teams","hooks_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/hooks","issue_events_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/issues/events{/number}","events_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/events","assignees_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/assignees{/user}","branches_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/branches{/branch}","tags_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/tags","blobs_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/git/refs{/sha}","trees_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/git/trees{/sha}","statuses_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/statuses/{sha}","languages_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/languages","stargazers_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/stargazers","contributors_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/contributors","subscribers_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/subscribers","subscription_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/subscription","commits_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/commits{/sha}","git_commits_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/git/commits{/sha}","comments_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/comments{/number}","issue_comment_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/issues/comments{/number}","contents_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/contents/{+path}","compare_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/compare/{base}...{head}","merges_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/merges","archive_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/downloads","issues_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/issues{/number}","pulls_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/pulls{/number}","milestones_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/milestones{/number}","notifications_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/labels{/name}","releases_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/releases{/id}","deployments_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/deployments","created_at":"2016-06-06T06:01:41Z","updated_at":"2016-10-02T08:26:43Z","pushed_at":"2016-10-17T07:51:27Z","git_url":"git://github.com/InfraSIM/infrasim-compute.git","ssh_url":"git@github.com:InfraSIM/infrasim-compute.git","clone_url":"https://github.com/InfraSIM/infrasim-compute.git","svn_url":"https://github.com/InfraSIM/infrasim-compute","homepage":null,"size":19426,"stargazers_count":6,"watchers_count":6,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":4,"forks":11,"open_issues":4,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/InfraSIM/infrasim-compute/pulls/113"},"html":{"href":"https://github.com/InfraSIM/infrasim-compute/pull/113"},"issue":{"href":"https://api.github.com/repos/InfraSIM/infrasim-compute/issues/113"},"comments":{"href":"https://api.github.com/repos/InfraSIM/infrasim-compute/issues/113/comments"},"review_comments":{"href":"https://api.github.com/repos/InfraSIM/infrasim-compute/pulls/113/comments"},"review_comment":{"href":"https://api.github.com/repos/InfraSIM/infrasim-compute/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/InfraSIM/infrasim-compute/pulls/113/commits"},"statuses":{"href":"https://api.github.com/repos/InfraSIM/infrasim-compute/statuses/42e14b9bb543939e9ab9a775c20f4a9d39c3216b"}}}}
{"actor":{"display_login":"houndci-bot"}}