{"action":"created","comment":{"url":"https://api.github.com/repos/RackHD/on-tasks/pulls/comments/48584221","id":48584221,"diff_hunk":"@@ -167,32 +167,45 @@ function installOsJobFactory(\n         var self = this;\n         var disk = self.options.installDisk;\n \n-        //If disk is empty then do nothing.\n         //If disk is string, it means user directly input the drive wwid, so don't need conversion.\n-        if ((!disk && disk !== 0) || _.isString(disk)) {\n+        if (_.isString(disk) && !_.isEmpty(disk)) {\n             return Promise.resolve(disk);\n         }\n \n-        if (!_.isNumber(disk)) {\n+        if (!_.isNumber(disk) && !_.isEmpty(disk)) {\n             return Promise.reject(new Error('The installDisk format is not correct'));\n         }\n \n-        //if it is integer, we think it is drive index, so we need to lookup the database to map\n-        //the drive index to drive WWID\n         return waterline.catalogs.findMostRecent({\n             node: self.nodeId,\n             source: 'driveId'\n         }).then(function(catalog) {\n-            var wwid = catalogSearch.findDriveWwidByIndex(\n-                catalog.data,\n-                (self.options.osType.toLowerCase() === 'esx'),\n-                disk\n-            );\n-\n-            if (!wwid) {\n-                return Promise.reject(new Error('Fail to find the WWID for installDisk'));\n+            var isEsx = /^esx$/i.test(self.options.osType);","path":"lib/jobs/install-os.js","position":30,"original_position":30,"commit_id":"adeab7b5b6827e9c0baba03573fd39bcd8869e9e","original_commit_id":"adeab7b5b6827e9c0baba03573fd39bcd8869e9e","user":{"login":"WangWinson","id":14069485,"avatar_url":"https://avatars.githubusercontent.com/u/14069485?v=3","gravatar_id":"","url":"https://api.github.com/users/WangWinson","html_url":"https://github.com/WangWinson","followers_url":"https://api.github.com/users/WangWinson/followers","following_url":"https://api.github.com/users/WangWinson/following{/other_user}","gists_url":"https://api.github.com/users/WangWinson/gists{/gist_id}","starred_url":"https://api.github.com/users/WangWinson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WangWinson/subscriptions","organizations_url":"https://api.github.com/users/WangWinson/orgs","repos_url":"https://api.github.com/users/WangWinson/repos","events_url":"https://api.github.com/users/WangWinson/events{/privacy}","received_events_url":"https://api.github.com/users/WangWinson/received_events","type":"User","site_admin":false},"body":"This means the ```osType``` should equals ```'esx'``` in lower case","created_at":"2015-12-30T02:37:02Z","updated_at":"2015-12-30T02:37:02Z","html_url":"https://github.com/RackHD/on-tasks/pull/100#discussion_r48584221","pull_request_url":"https://api.github.com/repos/RackHD/on-tasks/pulls/100","_links":{"self":{"href":"https://api.github.com/repos/RackHD/on-tasks/pulls/comments/48584221"},"html":{"href":"https://github.com/RackHD/on-tasks/pull/100#discussion_r48584221"},"pull_request":{"href":"https://api.github.com/repos/RackHD/on-tasks/pulls/100"}}},"pull_request":{"url":"https://api.github.com/repos/RackHD/on-tasks/pulls/100","id":54709693,"html_url":"https://github.com/RackHD/on-tasks/pull/100","diff_url":"https://github.com/RackHD/on-tasks/pull/100.diff","patch_url":"https://github.com/RackHD/on-tasks/pull/100.patch","issue_url":"https://api.github.com/repos/RackHD/on-tasks/issues/100","number":100,"state":"open","locked":false,"title":"MAG-439 Port ODR-338 solution to master","user":{"login":"WangWinson","id":14069485,"avatar_url":"https://avatars.githubusercontent.com/u/14069485?v=3","gravatar_id":"","url":"https://api.github.com/users/WangWinson","html_url":"https://github.com/WangWinson","followers_url":"https://api.github.com/users/WangWinson/followers","following_url":"https://api.github.com/users/WangWinson/following{/other_user}","gists_url":"https://api.github.com/users/WangWinson/gists{/gist_id}","starred_url":"https://api.github.com/users/WangWinson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WangWinson/subscriptions","organizations_url":"https://api.github.com/users/WangWinson/orgs","repos_url":"https://api.github.com/users/WangWinson/repos","events_url":"https://api.github.com/users/WangWinson/events{/privacy}","received_events_url":"https://api.github.com/users/WangWinson/received_events","type":"User","site_admin":false},"body":"- set default value ```firstdisk``` or ```sda``` when driveId catalog does not exist\r\n- throw error if installDisk is number but could not found in driveId catalog\r\n- when installDisk is empty, use wwid of SATADOM, if not exist use the first device in driveId catalog\r\n\r\n@RackHD/corecommitters @iceiilin @sunnyqianzhang @pengz1 @cgx027 \r\nThis change is similar to previous PR https://github.com/RackHD/on-tasks/pull/86 on 1.0 branch. Also, it covers https://github.com/RackHD/RackHD/issues/53","created_at":"2015-12-29T08:25:39Z","updated_at":"2015-12-30T02:37:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c297f3eb11dfcf577dc6e2611fdd1a06951e32bc","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/RackHD/on-tasks/pulls/100/commits","review_comments_url":"https://api.github.com/repos/RackHD/on-tasks/pulls/100/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/100/comments","statuses_url":"https://api.github.com/repos/RackHD/on-tasks/statuses/adeab7b5b6827e9c0baba03573fd39bcd8869e9e","head":{"label":"WangWinson:bugfix/Bootstrap","ref":"bugfix/Bootstrap","sha":"adeab7b5b6827e9c0baba03573fd39bcd8869e9e","user":{"login":"WangWinson","id":14069485,"avatar_url":"https://avatars.githubusercontent.com/u/14069485?v=3","gravatar_id":"","url":"https://api.github.com/users/WangWinson","html_url":"https://github.com/WangWinson","followers_url":"https://api.github.com/users/WangWinson/followers","following_url":"https://api.github.com/users/WangWinson/following{/other_user}","gists_url":"https://api.github.com/users/WangWinson/gists{/gist_id}","starred_url":"https://api.github.com/users/WangWinson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WangWinson/subscriptions","organizations_url":"https://api.github.com/users/WangWinson/orgs","repos_url":"https://api.github.com/users/WangWinson/repos","events_url":"https://api.github.com/users/WangWinson/events{/privacy}","received_events_url":"https://api.github.com/users/WangWinson/received_events","type":"User","site_admin":false},"repo":{"id":45824521,"name":"on-tasks","full_name":"WangWinson/on-tasks","owner":{"login":"WangWinson","id":14069485,"avatar_url":"https://avatars.githubusercontent.com/u/14069485?v=3","gravatar_id":"","url":"https://api.github.com/users/WangWinson","html_url":"https://github.com/WangWinson","followers_url":"https://api.github.com/users/WangWinson/followers","following_url":"https://api.github.com/users/WangWinson/following{/other_user}","gists_url":"https://api.github.com/users/WangWinson/gists{/gist_id}","starred_url":"https://api.github.com/users/WangWinson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WangWinson/subscriptions","organizations_url":"https://api.github.com/users/WangWinson/orgs","repos_url":"https://api.github.com/users/WangWinson/repos","events_url":"https://api.github.com/users/WangWinson/events{/privacy}","received_events_url":"https://api.github.com/users/WangWinson/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/WangWinson/on-tasks","description":"","fork":true,"url":"https://api.github.com/repos/WangWinson/on-tasks","forks_url":"https://api.github.com/repos/WangWinson/on-tasks/forks","keys_url":"https://api.github.com/repos/WangWinson/on-tasks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/WangWinson/on-tasks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/WangWinson/on-tasks/teams","hooks_url":"https://api.github.com/repos/WangWinson/on-tasks/hooks","issue_events_url":"https://api.github.com/repos/WangWinson/on-tasks/issues/events{/number}","events_url":"https://api.github.com/repos/WangWinson/on-tasks/events","assignees_url":"https://api.github.com/repos/WangWinson/on-tasks/assignees{/user}","branches_url":"https://api.github.com/repos/WangWinson/on-tasks/branches{/branch}","tags_url":"https://api.github.com/repos/WangWinson/on-tasks/tags","blobs_url":"https://api.github.com/repos/WangWinson/on-tasks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/WangWinson/on-tasks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/WangWinson/on-tasks/git/refs{/sha}","trees_url":"https://api.github.com/repos/WangWinson/on-tasks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/WangWinson/on-tasks/statuses/{sha}","languages_url":"https://api.github.com/repos/WangWinson/on-tasks/languages","stargazers_url":"https://api.github.com/repos/WangWinson/on-tasks/stargazers","contributors_url":"https://api.github.com/repos/WangWinson/on-tasks/contributors","subscribers_url":"https://api.github.com/repos/WangWinson/on-tasks/subscribers","subscription_url":"https://api.github.com/repos/WangWinson/on-tasks/subscription","commits_url":"https://api.github.com/repos/WangWinson/on-tasks/commits{/sha}","git_commits_url":"https://api.github.com/repos/WangWinson/on-tasks/git/commits{/sha}","comments_url":"https://api.github.com/repos/WangWinson/on-tasks/comments{/number}","issue_comment_url":"https://api.github.com/repos/WangWinson/on-tasks/issues/comments{/number}","contents_url":"https://api.github.com/repos/WangWinson/on-tasks/contents/{+path}","compare_url":"https://api.github.com/repos/WangWinson/on-tasks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/WangWinson/on-tasks/merges","archive_url":"https://api.github.com/repos/WangWinson/on-tasks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/WangWinson/on-tasks/downloads","issues_url":"https://api.github.com/repos/WangWinson/on-tasks/issues{/number}","pulls_url":"https://api.github.com/repos/WangWinson/on-tasks/pulls{/number}","milestones_url":"https://api.github.com/repos/WangWinson/on-tasks/milestones{/number}","notifications_url":"https://api.github.com/repos/WangWinson/on-tasks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/WangWinson/on-tasks/labels{/name}","releases_url":"https://api.github.com/repos/WangWinson/on-tasks/releases{/id}","created_at":"2015-11-09T08:17:51Z","updated_at":"2015-11-09T08:17:53Z","pushed_at":"2015-12-29T08:41:07Z","git_url":"git://github.com/WangWinson/on-tasks.git","ssh_url":"git@github.com:WangWinson/on-tasks.git","clone_url":"https://github.com/WangWinson/on-tasks.git","svn_url":"https://github.com/WangWinson/on-tasks","homepage":null,"size":939,"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":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"RackHD:master","ref":"master","sha":"678c07f9e7b0cffb9dd8e9471b0bd79c0d78bc58","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}","created_at":"2015-08-31T17:29:32Z","updated_at":"2015-12-08T20:00:24Z","pushed_at":"2015-12-29T08:41:07Z","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":980,"stargazers_count":4,"watchers_count":4,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":23,"mirror_url":null,"open_issues_count":3,"forks":23,"open_issues":3,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/RackHD/on-tasks/pulls/100"},"html":{"href":"https://github.com/RackHD/on-tasks/pull/100"},"issue":{"href":"https://api.github.com/repos/RackHD/on-tasks/issues/100"},"comments":{"href":"https://api.github.com/repos/RackHD/on-tasks/issues/100/comments"},"review_comments":{"href":"https://api.github.com/repos/RackHD/on-tasks/pulls/100/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/100/commits"},"statuses":{"href":"https://api.github.com/repos/RackHD/on-tasks/statuses/adeab7b5b6827e9c0baba03573fd39bcd8869e9e"}}}}