{"action":"created","comment":{"url":"https://api.github.com/repos/InfraSIM/infrasim-compute/pulls/comments/88819841","pull_request_review_id":9380867,"id":88819841,"diff_hunk":"@@ -48,6 +49,82 @@ def init_logger():\n     logger.addHandler(fh)\n \n \n+def init_env(instance):\n+    \"\"\"\n+    This is to sync ipmi-console with runtime vBMC configuration.\n+    Initial version capture infrasim instance name by infrasim-main status, while we\n+    have a plan to give instance name to ipmi-console so that it can be attached to\n+    target vBMC instance.\n+    \"\"\"\n+    logger.info(\"Init ipmi-console environment for infrasim instance: {}\".\n+                format(instance))\n+\n+    # Get runtime vbmc.conf\n+    vbmc_conf_path = os.path.join(os.environ[\"HOME\"], \".infrasim\", instance, \"data\", \"vbmc.conf\")\n+    if not os.path.exists(vbmc_conf_path):\n+        msg = \"{} vBMC configuration is not defined at {}\".format(instance, vbmc_conf_path)\n+        logger.error(msg)\n+        raise Exception(msg)\n+    else:\n+        msg = \"Target vbmc to attach is: {}\".format(vbmc_conf_path)\n+        logger.info(msg)\n+\n+    # Get runtime infrasim.yml\n+    infrasim_yml_path = os.path.join(os.environ[\"HOME\"], \".infrasim\", instance, \"data\", \"infrasim.yml\")\n+    if not os.path.exists(infrasim_yml_path):\n+        msg = \"{} infrasim instance is not defined at {}\".format(instance, infrasim_yml_path)\n+        logger.error(msg)\n+        raise Exception(msg)\n+    else:\n+        msg = \"Target infrasim instance to attach is: {}\".format(infrasim_yml_path)\n+        logger.info(msg)\n+\n+    # Get variable and set to ipmi-console env\n+    # - PORT_TELNET_TO_VBMC\n+    # - VBMC_IP\n+    # - VBMC_PORT\n+    with open(vbmc_conf_path, 'r') as fp:\n+        conf = fp.read()\n+\n+        p_telnet = re.compile(r\"^\\s*console\\s*[\\d:\\.]+\\s+(?P<port_telnet_to_vbmc>\\d+)\",","path":"infrasim/ipmicons/common.py","position":67,"original_position":67,"commit_id":"b0eae144860dbf43b4e3ab5d55933ea05ea8eec6","original_commit_id":"b0eae144860dbf43b4e3ab5d55933ea05ea8eec6","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 (87 > 79 characters)","created_at":"2016-11-21T01:59:23Z","updated_at":"2016-11-21T01:59:23Z","html_url":"https://github.com/InfraSIM/infrasim-compute/pull/146#discussion_r88819841","pull_request_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/pulls/146","_links":{"self":{"href":"https://api.github.com/repos/InfraSIM/infrasim-compute/pulls/comments/88819841"},"html":{"href":"https://github.com/InfraSIM/infrasim-compute/pull/146#discussion_r88819841"},"pull_request":{"href":"https://api.github.com/repos/InfraSIM/infrasim-compute/pulls/146"}}},"pull_request":{"url":"https://api.github.com/repos/InfraSIM/infrasim-compute/pulls/146","id":94543996,"html_url":"https://github.com/InfraSIM/infrasim-compute/pull/146","diff_url":"https://github.com/InfraSIM/infrasim-compute/pull/146.diff","patch_url":"https://github.com/InfraSIM/infrasim-compute/pull/146.patch","issue_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/issues/146","number":146,"state":"open","locked":false,"title":"Merge infrasim-3.0 to master","user":{"login":"xiar","id":14065584,"avatar_url":"https://avatars.githubusercontent.com/u/14065584?v=3","gravatar_id":"","url":"https://api.github.com/users/xiar","html_url":"https://github.com/xiar","followers_url":"https://api.github.com/users/xiar/followers","following_url":"https://api.github.com/users/xiar/following{/other_user}","gists_url":"https://api.github.com/users/xiar/gists{/gist_id}","starred_url":"https://api.github.com/users/xiar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xiar/subscriptions","organizations_url":"https://api.github.com/users/xiar/orgs","repos_url":"https://api.github.com/users/xiar/repos","events_url":"https://api.github.com/users/xiar/events{/privacy}","received_events_url":"https://api.github.com/users/xiar/received_events","type":"User","site_admin":false},"body":"b6f47b3 \r\n===\t\r\n1. Add Dell R730 data\r\n2. Add 'ioport' and 'irq' options for isa-ipmi-kcs device.\r\n3. Add more example options in infrasim.full.yaml\r\n\r\nd6a2628\r\n===\r\nUpdate Dell R730XD BMC emulation data \t\t\t\r\n\r\na61897c\r\n===\r\nAdding supported adjustable properties in yml \t\t\r\n\r\n23051ed\r\n===\t\r\nupdate readme to point to correct configuration file \t\t\r\n\r\n19a4d61\r\n===\t\r\nUpdate example yml to add comment on their purpose in the beginning \t\t\r\n\r\ned95d2b\r\n===\t\r\nChange version number to 3.0.0 \t\r\n\r\nb10097e\r\n===\t\t\r\nbugfix/sync_ipmi_console_interface\r\nAdded `ipmi_console_ssh` attribute to infrasim.yml.\r\nEnable environment for ipmi-console\r\n- PORT_TELNET_TO_VBMC\r\n- PORT_SSH_FOR_CLIENT\r\n- VBMC_IP\r\n- VBMC_PORT\r\nAll these environment variables are init from runtime instance\r\nconfiguration.\r\n\r\nAdded functional test class `test_ipmi_console_config_change`\r\n- test_ipmi_console_valid_port\r\n- test_ipmi_console_invalid_port\r\n- test_ipmi_console_valid_ssh\r\n- test_ipmi_console_invalid_ssh\r\n\r\nb063b8b\r\n===\r\nbugfix/sync_ipmi_console_interface\r\n\r\nEnhance `daemonize()`\r\nIf peripheral program close stdout already, daemonize won't try\r\nto copy fd to /dev/null.\r\nPreviously, it cause an exception with empty stdout.\r\n\r\n48e801b\r\n===\t\t\r\nAdd MD5 check in functional test \t\t\r\n\r\n9faf9aa\r\n===\t\r\nbugfix/sync_ipmi_console_interface\r\n\r\nFix bug in `ipmicons.common.init_env()`\r\n- When vBMC is listening on a certain IP, ipmi-console env use that IP\r\n\r\nAdded unit test for init_env()\r\n- test_ipmi_console_default_env\r\n- test_ipmi_console_customized_env\r\n\r\nb0eae14\t\t\r\n===\r\nUpdate default example\r\nCorrect cpu definition.","created_at":"2016-11-21T01:59:09Z","updated_at":"2016-11-21T01:59:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8aa9831a290d93814a233f9749312881ed848c0a","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/pulls/146/commits","review_comments_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/pulls/146/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/146/comments","statuses_url":"https://api.github.com/repos/InfraSIM/infrasim-compute/statuses/b0eae144860dbf43b4e3ab5d55933ea05ea8eec6","head":{"label":"xiar:master","ref":"master","sha":"b0eae144860dbf43b4e3ab5d55933ea05ea8eec6","user":{"login":"xiar","id":14065584,"avatar_url":"https://avatars.githubusercontent.com/u/14065584?v=3","gravatar_id":"","url":"https://api.github.com/users/xiar","html_url":"https://github.com/xiar","followers_url":"https://api.github.com/users/xiar/followers","following_url":"https://api.github.com/users/xiar/following{/other_user}","gists_url":"https://api.github.com/users/xiar/gists{/gist_id}","starred_url":"https://api.github.com/users/xiar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xiar/subscriptions","organizations_url":"https://api.github.com/users/xiar/orgs","repos_url":"https://api.github.com/users/xiar/repos","events_url":"https://api.github.com/users/xiar/events{/privacy}","received_events_url":"https://api.github.com/users/xiar/received_events","type":"User","site_admin":false},"repo":{"id":67292120,"name":"infrasim-compute","full_name":"xiar/infrasim-compute","owner":{"login":"xiar","id":14065584,"avatar_url":"https://avatars.githubusercontent.com/u/14065584?v=3","gravatar_id":"","url":"https://api.github.com/users/xiar","html_url":"https://github.com/xiar","followers_url":"https://api.github.com/users/xiar/followers","following_url":"https://api.github.com/users/xiar/following{/other_user}","gists_url":"https://api.github.com/users/xiar/gists{/gist_id}","starred_url":"https://api.github.com/users/xiar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xiar/subscriptions","organizations_url":"https://api.github.com/users/xiar/orgs","repos_url":"https://api.github.com/users/xiar/repos","events_url":"https://api.github.com/users/xiar/events{/privacy}","received_events_url":"https://api.github.com/users/xiar/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/xiar/infrasim-compute","description":null,"fork":true,"url":"https://api.github.com/repos/xiar/infrasim-compute","forks_url":"https://api.github.com/repos/xiar/infrasim-compute/forks","keys_url":"https://api.github.com/repos/xiar/infrasim-compute/keys{/key_id}","collaborators_url":"https://api.github.com/repos/xiar/infrasim-compute/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/xiar/infrasim-compute/teams","hooks_url":"https://api.github.com/repos/xiar/infrasim-compute/hooks","issue_events_url":"https://api.github.com/repos/xiar/infrasim-compute/issues/events{/number}","events_url":"https://api.github.com/repos/xiar/infrasim-compute/events","assignees_url":"https://api.github.com/repos/xiar/infrasim-compute/assignees{/user}","branches_url":"https://api.github.com/repos/xiar/infrasim-compute/branches{/branch}","tags_url":"https://api.github.com/repos/xiar/infrasim-compute/tags","blobs_url":"https://api.github.com/repos/xiar/infrasim-compute/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/xiar/infrasim-compute/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/xiar/infrasim-compute/git/refs{/sha}","trees_url":"https://api.github.com/repos/xiar/infrasim-compute/git/trees{/sha}","statuses_url":"https://api.github.com/repos/xiar/infrasim-compute/statuses/{sha}","languages_url":"https://api.github.com/repos/xiar/infrasim-compute/languages","stargazers_url":"https://api.github.com/repos/xiar/infrasim-compute/stargazers","contributors_url":"https://api.github.com/repos/xiar/infrasim-compute/contributors","subscribers_url":"https://api.github.com/repos/xiar/infrasim-compute/subscribers","subscription_url":"https://api.github.com/repos/xiar/infrasim-compute/subscription","commits_url":"https://api.github.com/repos/xiar/infrasim-compute/commits{/sha}","git_commits_url":"https://api.github.com/repos/xiar/infrasim-compute/git/commits{/sha}","comments_url":"https://api.github.com/repos/xiar/infrasim-compute/comments{/number}","issue_comment_url":"https://api.github.com/repos/xiar/infrasim-compute/issues/comments{/number}","contents_url":"https://api.github.com/repos/xiar/infrasim-compute/contents/{+path}","compare_url":"https://api.github.com/repos/xiar/infrasim-compute/compare/{base}...{head}","merges_url":"https://api.github.com/repos/xiar/infrasim-compute/merges","archive_url":"https://api.github.com/repos/xiar/infrasim-compute/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/xiar/infrasim-compute/downloads","issues_url":"https://api.github.com/repos/xiar/infrasim-compute/issues{/number}","pulls_url":"https://api.github.com/repos/xiar/infrasim-compute/pulls{/number}","milestones_url":"https://api.github.com/repos/xiar/infrasim-compute/milestones{/number}","notifications_url":"https://api.github.com/repos/xiar/infrasim-compute/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/xiar/infrasim-compute/labels{/name}","releases_url":"https://api.github.com/repos/xiar/infrasim-compute/releases{/id}","deployments_url":"https://api.github.com/repos/xiar/infrasim-compute/deployments","created_at":"2016-09-03T13:40:00Z","updated_at":"2016-10-25T10:20:19Z","pushed_at":"2016-11-21T01:52:54Z","git_url":"git://github.com/xiar/infrasim-compute.git","ssh_url":"git@github.com:xiar/infrasim-compute.git","clone_url":"https://github.com/xiar/infrasim-compute.git","svn_url":"https://github.com/xiar/infrasim-compute","homepage":null,"size":19462,"stargazers_count":1,"watchers_count":1,"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":1,"default_branch":"master"}},"base":{"label":"InfraSIM:master","ref":"master","sha":"214351de44dd04b51994a952fd2f062626553245","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-25T06:46:36Z","pushed_at":"2016-11-21T01:59:09Z","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":19525,"stargazers_count":6,"watchers_count":6,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"open_issues_count":3,"forks":12,"open_issues":3,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/InfraSIM/infrasim-compute/pulls/146"},"html":{"href":"https://github.com/InfraSIM/infrasim-compute/pull/146"},"issue":{"href":"https://api.github.com/repos/InfraSIM/infrasim-compute/issues/146"},"comments":{"href":"https://api.github.com/repos/InfraSIM/infrasim-compute/issues/146/comments"},"review_comments":{"href":"https://api.github.com/repos/InfraSIM/infrasim-compute/pulls/146/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/146/commits"},"statuses":{"href":"https://api.github.com/repos/InfraSIM/infrasim-compute/statuses/b0eae144860dbf43b4e3ab5d55933ea05ea8eec6"}}}}
{"actor":{"display_login":"houndci-bot"}}