{"action":"created","comment":{"url":"https://api.github.com/repos/RackHD/on-tasks/pulls/comments/74783118","id":74783118,"diff_hunk":"@@ -4,21 +4,54 @@\n \n var di = require('di');\n \n-module.exports = factory;\n-di.annotate(factory, new di.Provide('Services.Task'));\n-di.annotate(factory, new di.Inject(\n+module.exports = taskServiceFactory;\n+di.annotate(taskServiceFactory, new di.Provide('Services.Task'));\n+di.annotate(taskServiceFactory, new di.Inject(\n+    'Logger',\n+    'Promise',\n+    'ChildProcess',\n     'TaskOption.Validator'\n ));\n \n-function factory(validator) {\n+function taskServiceFactory(\n+    Logger,\n+    Promise,\n+    ChildProcess,\n+    validator\n+) {\n+    var logger = Logger.initialize(taskServiceFactory);\n+    var requiredCmdTools = ['ipmitool'];","path":"lib/task-service.js","position":24,"original_position":24,"commit_id":"c420e59a4358ca6b791d6e48a50bba9c7a8414e4","original_commit_id":"c420e59a4358ca6b791d6e48a50bba9c7a8414e4","user":{"login":"yyscamper","id":511378,"avatar_url":"https://avatars.githubusercontent.com/u/511378?v=3","gravatar_id":"","url":"https://api.github.com/users/yyscamper","html_url":"https://github.com/yyscamper","followers_url":"https://api.github.com/users/yyscamper/followers","following_url":"https://api.github.com/users/yyscamper/following{/other_user}","gists_url":"https://api.github.com/users/yyscamper/gists{/gist_id}","starred_url":"https://api.github.com/users/yyscamper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yyscamper/subscriptions","organizations_url":"https://api.github.com/users/yyscamper/orgs","repos_url":"https://api.github.com/users/yyscamper/repos","events_url":"https://api.github.com/users/yyscamper/events{/privacy}","received_events_url":"https://api.github.com/users/yyscamper/received_events","type":"User","site_admin":false},"body":"As I said in the PR comment, I purposely only adding the ipmitool and I see the snmp and racadm  tool aren't used too often, especially the racadm tool is only used for Dell server and a few tasks, it's even not easy to install it. So if preventing user to use RackHD if not installing some not required tool (for user's special user case) doesn't make sense.\r\n\r\nBut I'm OK to include more if you think that's necessary.\r\n\r\nAs for why not define it as constant, since I thought the `requiredCmdTools` vary with different customers, so maybe it's better to be a configuration item or even get some input from skupack (like the racadm tool for Dell Servers).\r\n\r\nDo you have any good idea to handle this?","created_at":"2016-08-15T15:51:02Z","updated_at":"2016-08-15T15:51:02Z","html_url":"https://github.com/RackHD/on-tasks/pull/315#discussion_r74783118","pull_request_url":"https://api.github.com/repos/RackHD/on-tasks/pulls/315","_links":{"self":{"href":"https://api.github.com/repos/RackHD/on-tasks/pulls/comments/74783118"},"html":{"href":"https://github.com/RackHD/on-tasks/pull/315#discussion_r74783118"},"pull_request":{"href":"https://api.github.com/repos/RackHD/on-tasks/pulls/315"}}},"pull_request":{"url":"https://api.github.com/repos/RackHD/on-tasks/pulls/315","id":81271217,"html_url":"https://github.com/RackHD/on-tasks/pull/315","diff_url":"https://github.com/RackHD/on-tasks/pull/315.diff","patch_url":"https://github.com/RackHD/on-tasks/pull/315.patch","issue_url":"https://api.github.com/repos/RackHD/on-tasks/issues/315","number":315,"state":"open","locked":false,"title":"Issue#155: check existence of required command tools when on-tasks starts","user":{"login":"yyscamper","id":511378,"avatar_url":"https://avatars.githubusercontent.com/u/511378?v=3","gravatar_id":"","url":"https://api.github.com/users/yyscamper","html_url":"https://github.com/yyscamper","followers_url":"https://api.github.com/users/yyscamper/followers","following_url":"https://api.github.com/users/yyscamper/following{/other_user}","gists_url":"https://api.github.com/users/yyscamper/gists{/gist_id}","starred_url":"https://api.github.com/users/yyscamper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yyscamper/subscriptions","organizations_url":"https://api.github.com/users/yyscamper/orgs","repos_url":"https://api.github.com/users/yyscamper/repos","events_url":"https://api.github.com/users/yyscamper/events{/privacy}","received_events_url":"https://api.github.com/users/yyscamper/received_events","type":"User","site_admin":false},"body":"Related issue: https://github.com/RackHD/RackHD/issues/155\r\n\r\nIn some system, the ipmitool may not always be installed in /usr/bin, the fix is to check the existence of some required commend line tools before on-tasks starts, so that user can be aware of such issue at very early stage.\r\n\r\nFor the new change, RackHD will use `ipmitool` rather than `usr/bin/ipmitool`, this let user to make sure adding tool in the $PATH.\r\n\r\nAt present, I only add `ipmitool` as required tools, not including the `snmp` because I see most people doesn't have the chance to try the snmp related functionality. If you have concern, It's OK for me to include `snmp` as well.\r\n\r\n@RackHD/corecommitters @heckj @codenrhoden @jgolio ","created_at":"2016-08-15T05:16:49Z","updated_at":"2016-08-15T15:51:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fb987a3b3931bac30f35dbd82107c5487e431d5b","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/RackHD/on-tasks/pulls/315/commits","review_comments_url":"https://api.github.com/repos/RackHD/on-tasks/pulls/315/comments","review_comment_url":"https://api.github.com/repos/RackHD/on-tasks/pulls/comments{/number}","comments_url":"https://api.github.com/repos/RackHD/on-tasks/issues/315/comments","statuses_url":"https://api.github.com/repos/RackHD/on-tasks/statuses/c420e59a4358ca6b791d6e48a50bba9c7a8414e4","head":{"label":"yyscamper:ipmitool","ref":"ipmitool","sha":"c420e59a4358ca6b791d6e48a50bba9c7a8414e4","user":{"login":"yyscamper","id":511378,"avatar_url":"https://avatars.githubusercontent.com/u/511378?v=3","gravatar_id":"","url":"https://api.github.com/users/yyscamper","html_url":"https://github.com/yyscamper","followers_url":"https://api.github.com/users/yyscamper/followers","following_url":"https://api.github.com/users/yyscamper/following{/other_user}","gists_url":"https://api.github.com/users/yyscamper/gists{/gist_id}","starred_url":"https://api.github.com/users/yyscamper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yyscamper/subscriptions","organizations_url":"https://api.github.com/users/yyscamper/orgs","repos_url":"https://api.github.com/users/yyscamper/repos","events_url":"https://api.github.com/users/yyscamper/events{/privacy}","received_events_url":"https://api.github.com/users/yyscamper/received_events","type":"User","site_admin":false},"repo":{"id":45583947,"name":"on-tasks","full_name":"yyscamper/on-tasks","owner":{"login":"yyscamper","id":511378,"avatar_url":"https://avatars.githubusercontent.com/u/511378?v=3","gravatar_id":"","url":"https://api.github.com/users/yyscamper","html_url":"https://github.com/yyscamper","followers_url":"https://api.github.com/users/yyscamper/followers","following_url":"https://api.github.com/users/yyscamper/following{/other_user}","gists_url":"https://api.github.com/users/yyscamper/gists{/gist_id}","starred_url":"https://api.github.com/users/yyscamper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yyscamper/subscriptions","organizations_url":"https://api.github.com/users/yyscamper/orgs","repos_url":"https://api.github.com/users/yyscamper/repos","events_url":"https://api.github.com/users/yyscamper/events{/privacy}","received_events_url":"https://api.github.com/users/yyscamper/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/yyscamper/on-tasks","description":"","fork":true,"url":"https://api.github.com/repos/yyscamper/on-tasks","forks_url":"https://api.github.com/repos/yyscamper/on-tasks/forks","keys_url":"https://api.github.com/repos/yyscamper/on-tasks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yyscamper/on-tasks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yyscamper/on-tasks/teams","hooks_url":"https://api.github.com/repos/yyscamper/on-tasks/hooks","issue_events_url":"https://api.github.com/repos/yyscamper/on-tasks/issues/events{/number}","events_url":"https://api.github.com/repos/yyscamper/on-tasks/events","assignees_url":"https://api.github.com/repos/yyscamper/on-tasks/assignees{/user}","branches_url":"https://api.github.com/repos/yyscamper/on-tasks/branches{/branch}","tags_url":"https://api.github.com/repos/yyscamper/on-tasks/tags","blobs_url":"https://api.github.com/repos/yyscamper/on-tasks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yyscamper/on-tasks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yyscamper/on-tasks/git/refs{/sha}","trees_url":"https://api.github.com/repos/yyscamper/on-tasks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yyscamper/on-tasks/statuses/{sha}","languages_url":"https://api.github.com/repos/yyscamper/on-tasks/languages","stargazers_url":"https://api.github.com/repos/yyscamper/on-tasks/stargazers","contributors_url":"https://api.github.com/repos/yyscamper/on-tasks/contributors","subscribers_url":"https://api.github.com/repos/yyscamper/on-tasks/subscribers","subscription_url":"https://api.github.com/repos/yyscamper/on-tasks/subscription","commits_url":"https://api.github.com/repos/yyscamper/on-tasks/commits{/sha}","git_commits_url":"https://api.github.com/repos/yyscamper/on-tasks/git/commits{/sha}","comments_url":"https://api.github.com/repos/yyscamper/on-tasks/comments{/number}","issue_comment_url":"https://api.github.com/repos/yyscamper/on-tasks/issues/comments{/number}","contents_url":"https://api.github.com/repos/yyscamper/on-tasks/contents/{+path}","compare_url":"https://api.github.com/repos/yyscamper/on-tasks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yyscamper/on-tasks/merges","archive_url":"https://api.github.com/repos/yyscamper/on-tasks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yyscamper/on-tasks/downloads","issues_url":"https://api.github.com/repos/yyscamper/on-tasks/issues{/number}","pulls_url":"https://api.github.com/repos/yyscamper/on-tasks/pulls{/number}","milestones_url":"https://api.github.com/repos/yyscamper/on-tasks/milestones{/number}","notifications_url":"https://api.github.com/repos/yyscamper/on-tasks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yyscamper/on-tasks/labels{/name}","releases_url":"https://api.github.com/repos/yyscamper/on-tasks/releases{/id}","deployments_url":"https://api.github.com/repos/yyscamper/on-tasks/deployments","created_at":"2015-11-05T03:07:36Z","updated_at":"2016-01-20T05:44:20Z","pushed_at":"2016-08-15T05:11:18Z","git_url":"git://github.com/yyscamper/on-tasks.git","ssh_url":"git@github.com:yyscamper/on-tasks.git","clone_url":"https://github.com/yyscamper/on-tasks.git","svn_url":"https://github.com/yyscamper/on-tasks","homepage":null,"size":1786,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":7,"forks":0,"open_issues":7,"watchers":0,"default_branch":"master"}},"base":{"label":"RackHD:master","ref":"master","sha":"ede293f0ab5dbdf86f394d53d03fe40398fae937","user":{"login":"RackHD","id":13982662,"avatar_url":"https://avatars.githubusercontent.com/u/13982662?v=3","gravatar_id":"","url":"https://api.github.com/users/RackHD","html_url":"https://github.com/RackHD","followers_url":"https://api.github.com/users/RackHD/followers","following_url":"https://api.github.com/users/RackHD/following{/other_user}","gists_url":"https://api.github.com/users/RackHD/gists{/gist_id}","starred_url":"https://api.github.com/users/RackHD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RackHD/subscriptions","organizations_url":"https://api.github.com/users/RackHD/orgs","repos_url":"https://api.github.com/users/RackHD/repos","events_url":"https://api.github.com/users/RackHD/events{/privacy}","received_events_url":"https://api.github.com/users/RackHD/received_events","type":"Organization","site_admin":false},"repo":{"id":41690099,"name":"on-tasks","full_name":"RackHD/on-tasks","owner":{"login":"RackHD","id":13982662,"avatar_url":"https://avatars.githubusercontent.com/u/13982662?v=3","gravatar_id":"","url":"https://api.github.com/users/RackHD","html_url":"https://github.com/RackHD","followers_url":"https://api.github.com/users/RackHD/followers","following_url":"https://api.github.com/users/RackHD/following{/other_user}","gists_url":"https://api.github.com/users/RackHD/gists{/gist_id}","starred_url":"https://api.github.com/users/RackHD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RackHD/subscriptions","organizations_url":"https://api.github.com/users/RackHD/orgs","repos_url":"https://api.github.com/users/RackHD/repos","events_url":"https://api.github.com/users/RackHD/events{/privacy}","received_events_url":"https://api.github.com/users/RackHD/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/RackHD/on-tasks","description":"","fork":false,"url":"https://api.github.com/repos/RackHD/on-tasks","forks_url":"https://api.github.com/repos/RackHD/on-tasks/forks","keys_url":"https://api.github.com/repos/RackHD/on-tasks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/RackHD/on-tasks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/RackHD/on-tasks/teams","hooks_url":"https://api.github.com/repos/RackHD/on-tasks/hooks","issue_events_url":"https://api.github.com/repos/RackHD/on-tasks/issues/events{/number}","events_url":"https://api.github.com/repos/RackHD/on-tasks/events","assignees_url":"https://api.github.com/repos/RackHD/on-tasks/assignees{/user}","branches_url":"https://api.github.com/repos/RackHD/on-tasks/branches{/branch}","tags_url":"https://api.github.com/repos/RackHD/on-tasks/tags","blobs_url":"https://api.github.com/repos/RackHD/on-tasks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/RackHD/on-tasks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/RackHD/on-tasks/git/refs{/sha}","trees_url":"https://api.github.com/repos/RackHD/on-tasks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/RackHD/on-tasks/statuses/{sha}","languages_url":"https://api.github.com/repos/RackHD/on-tasks/languages","stargazers_url":"https://api.github.com/repos/RackHD/on-tasks/stargazers","contributors_url":"https://api.github.com/repos/RackHD/on-tasks/contributors","subscribers_url":"https://api.github.com/repos/RackHD/on-tasks/subscribers","subscription_url":"https://api.github.com/repos/RackHD/on-tasks/subscription","commits_url":"https://api.github.com/repos/RackHD/on-tasks/commits{/sha}","git_commits_url":"https://api.github.com/repos/RackHD/on-tasks/git/commits{/sha}","comments_url":"https://api.github.com/repos/RackHD/on-tasks/comments{/number}","issue_comment_url":"https://api.github.com/repos/RackHD/on-tasks/issues/comments{/number}","contents_url":"https://api.github.com/repos/RackHD/on-tasks/contents/{+path}","compare_url":"https://api.github.com/repos/RackHD/on-tasks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/RackHD/on-tasks/merges","archive_url":"https://api.github.com/repos/RackHD/on-tasks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/RackHD/on-tasks/downloads","issues_url":"https://api.github.com/repos/RackHD/on-tasks/issues{/number}","pulls_url":"https://api.github.com/repos/RackHD/on-tasks/pulls{/number}","milestones_url":"https://api.github.com/repos/RackHD/on-tasks/milestones{/number}","notifications_url":"https://api.github.com/repos/RackHD/on-tasks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/RackHD/on-tasks/labels{/name}","releases_url":"https://api.github.com/repos/RackHD/on-tasks/releases{/id}","deployments_url":"https://api.github.com/repos/RackHD/on-tasks/deployments","created_at":"2015-08-31T17:29:32Z","updated_at":"2016-05-17T08:18:08Z","pushed_at":"2016-08-15T05:16:50Z","git_url":"git://github.com/RackHD/on-tasks.git","ssh_url":"git@github.com:RackHD/on-tasks.git","clone_url":"https://github.com/RackHD/on-tasks.git","svn_url":"https://github.com/RackHD/on-tasks","homepage":null,"size":1934,"stargazers_count":7,"watchers_count":7,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":46,"mirror_url":null,"open_issues_count":8,"forks":46,"open_issues":8,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/RackHD/on-tasks/pulls/315"},"html":{"href":"https://github.com/RackHD/on-tasks/pull/315"},"issue":{"href":"https://api.github.com/repos/RackHD/on-tasks/issues/315"},"comments":{"href":"https://api.github.com/repos/RackHD/on-tasks/issues/315/comments"},"review_comments":{"href":"https://api.github.com/repos/RackHD/on-tasks/pulls/315/comments"},"review_comment":{"href":"https://api.github.com/repos/RackHD/on-tasks/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/RackHD/on-tasks/pulls/315/commits"},"statuses":{"href":"https://api.github.com/repos/RackHD/on-tasks/statuses/c420e59a4358ca6b791d6e48a50bba9c7a8414e4"}}}}
{"actor":{"display_login":"yyscamper"}}