{"action":"created","comment":{"url":"https://api.github.com/repos/RackHD/on-tasks/pulls/comments/60646484","id":60646484,"diff_hunk":"@@ -0,0 +1,71 @@\n+// Copyright 2016, EMC, Inc.\n+\n+'use strict';\n+\n+var di = require('di');\n+module.exports = copyKeyJobFactory;\n+\n+di.annotate(copyKeyJobFactory, new di.Provide('Job.CopyKey'));\n+di.annotate(copyKeyJobFactory, new di.Inject(\n+    'Job.Base',\n+    'Util',\n+    'Logger',\n+    'Assert',\n+    'Promise',\n+    'Services.Waterline',\n+    'ssh',\n+    'JobUtils.Commands'\n+));\n+\n+function copyKeyJobFactory(\n+    BaseJob,\n+    util,\n+    Logger,\n+    assert,\n+    Promise,\n+    waterline,\n+    ssh,\n+    CommandUtil\n+) {\n+    var logger = Logger.initialize(copyKeyJobFactory);\n+    var commandUtil;\n+    function CopyKeyJob(options, context, taskId) {\n+        CopyKeyJob.super_.call(this, logger, options, context, taskId);\n+        assert.string(this.context.target);\n+        this.nodeId = this.context.target;\n+        commandUtil = new CommandUtil(this.nodeId);\n+    }\n+    util.inherits(CopyKeyJob, BaseJob);\n+\n+    CopyKeyJob.prototype._run = function run() {\n+        var self = this;\n+        return waterline.nodes.needByIdentifier(self.nodeId)\n+        .then(function(node) {\n+            var commands = [\n+                {cmd: 'mkdir -p .ssh'},\n+                {cmd: 'echo '+node.sshSettings.publicKey+' >> .ssh/authorized_keys'}","path":"lib/jobs/copy-publickey.js","position":46,"original_position":46,"commit_id":"3e638ac950441bf5567c05ecd4d26f0315426248","original_commit_id":"3e638ac950441bf5567c05ecd4d26f0315426248","user":{"login":"zyoung51","id":13998687,"avatar_url":"https://avatars.githubusercontent.com/u/13998687?v=3","gravatar_id":"","url":"https://api.github.com/users/zyoung51","html_url":"https://github.com/zyoung51","followers_url":"https://api.github.com/users/zyoung51/followers","following_url":"https://api.github.com/users/zyoung51/following{/other_user}","gists_url":"https://api.github.com/users/zyoung51/gists{/gist_id}","starred_url":"https://api.github.com/users/zyoung51/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zyoung51/subscriptions","organizations_url":"https://api.github.com/users/zyoung51/orgs","repos_url":"https://api.github.com/users/zyoung51/repos","events_url":"https://api.github.com/users/zyoung51/events{/privacy}","received_events_url":"https://api.github.com/users/zyoung51/received_events","type":"User","site_admin":false},"body":"Should there be a check to ensure the publicKey exists?","created_at":"2016-04-21T20:06:16Z","updated_at":"2016-04-21T20:06:16Z","html_url":"https://github.com/RackHD/on-tasks/pull/168#discussion_r60646484","pull_request_url":"https://api.github.com/repos/RackHD/on-tasks/pulls/168","_links":{"self":{"href":"https://api.github.com/repos/RackHD/on-tasks/pulls/comments/60646484"},"html":{"href":"https://github.com/RackHD/on-tasks/pull/168#discussion_r60646484"},"pull_request":{"href":"https://api.github.com/repos/RackHD/on-tasks/pulls/168"}}},"pull_request":{"url":"https://api.github.com/repos/RackHD/on-tasks/pulls/168","id":67412264,"html_url":"https://github.com/RackHD/on-tasks/pull/168","diff_url":"https://github.com/RackHD/on-tasks/pull/168.diff","patch_url":"https://github.com/RackHD/on-tasks/pull/168.patch","issue_url":"https://api.github.com/repos/RackHD/on-tasks/issues/168","number":168,"state":"open","locked":false,"title":"added copykey job and tasks","user":{"login":"VulpesArtificem","id":5447423,"avatar_url":"https://avatars.githubusercontent.com/u/5447423?v=3","gravatar_id":"","url":"https://api.github.com/users/VulpesArtificem","html_url":"https://github.com/VulpesArtificem","followers_url":"https://api.github.com/users/VulpesArtificem/followers","following_url":"https://api.github.com/users/VulpesArtificem/following{/other_user}","gists_url":"https://api.github.com/users/VulpesArtificem/gists{/gist_id}","starred_url":"https://api.github.com/users/VulpesArtificem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VulpesArtificem/subscriptions","organizations_url":"https://api.github.com/users/VulpesArtificem/orgs","repos_url":"https://api.github.com/users/VulpesArtificem/repos","events_url":"https://api.github.com/users/VulpesArtificem/events{/privacy}","received_events_url":"https://api.github.com/users/VulpesArtificem/received_events","type":"User","site_admin":false},"body":"more support for in-band management: added a job/tasks for copying an ssh public key to a node. Also refactored the sshExec method from ssh-job into command-util. \r\n\r\nshould probably wait on https://github.com/RackHD/on-tasks/pull/150 to merge \r\n@benbp ","created_at":"2016-04-21T19:53:56Z","updated_at":"2016-04-21T20:06:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2831ad58b63f0946fb44e57bdf688ade5292cb23","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/RackHD/on-tasks/pulls/168/commits","review_comments_url":"https://api.github.com/repos/RackHD/on-tasks/pulls/168/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/168/comments","statuses_url":"https://api.github.com/repos/RackHD/on-tasks/statuses/3e638ac950441bf5567c05ecd4d26f0315426248","head":{"label":"VulpesArtificem:copy-key","ref":"copy-key","sha":"3e638ac950441bf5567c05ecd4d26f0315426248","user":{"login":"VulpesArtificem","id":5447423,"avatar_url":"https://avatars.githubusercontent.com/u/5447423?v=3","gravatar_id":"","url":"https://api.github.com/users/VulpesArtificem","html_url":"https://github.com/VulpesArtificem","followers_url":"https://api.github.com/users/VulpesArtificem/followers","following_url":"https://api.github.com/users/VulpesArtificem/following{/other_user}","gists_url":"https://api.github.com/users/VulpesArtificem/gists{/gist_id}","starred_url":"https://api.github.com/users/VulpesArtificem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VulpesArtificem/subscriptions","organizations_url":"https://api.github.com/users/VulpesArtificem/orgs","repos_url":"https://api.github.com/users/VulpesArtificem/repos","events_url":"https://api.github.com/users/VulpesArtificem/events{/privacy}","received_events_url":"https://api.github.com/users/VulpesArtificem/received_events","type":"User","site_admin":false},"repo":{"id":45429601,"name":"on-tasks","full_name":"VulpesArtificem/on-tasks","owner":{"login":"VulpesArtificem","id":5447423,"avatar_url":"https://avatars.githubusercontent.com/u/5447423?v=3","gravatar_id":"","url":"https://api.github.com/users/VulpesArtificem","html_url":"https://github.com/VulpesArtificem","followers_url":"https://api.github.com/users/VulpesArtificem/followers","following_url":"https://api.github.com/users/VulpesArtificem/following{/other_user}","gists_url":"https://api.github.com/users/VulpesArtificem/gists{/gist_id}","starred_url":"https://api.github.com/users/VulpesArtificem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VulpesArtificem/subscriptions","organizations_url":"https://api.github.com/users/VulpesArtificem/orgs","repos_url":"https://api.github.com/users/VulpesArtificem/repos","events_url":"https://api.github.com/users/VulpesArtificem/events{/privacy}","received_events_url":"https://api.github.com/users/VulpesArtificem/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/VulpesArtificem/on-tasks","description":"","fork":true,"url":"https://api.github.com/repos/VulpesArtificem/on-tasks","forks_url":"https://api.github.com/repos/VulpesArtificem/on-tasks/forks","keys_url":"https://api.github.com/repos/VulpesArtificem/on-tasks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/VulpesArtificem/on-tasks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/VulpesArtificem/on-tasks/teams","hooks_url":"https://api.github.com/repos/VulpesArtificem/on-tasks/hooks","issue_events_url":"https://api.github.com/repos/VulpesArtificem/on-tasks/issues/events{/number}","events_url":"https://api.github.com/repos/VulpesArtificem/on-tasks/events","assignees_url":"https://api.github.com/repos/VulpesArtificem/on-tasks/assignees{/user}","branches_url":"https://api.github.com/repos/VulpesArtificem/on-tasks/branches{/branch}","tags_url":"https://api.github.com/repos/VulpesArtificem/on-tasks/tags","blobs_url":"https://api.github.com/repos/VulpesArtificem/on-tasks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/VulpesArtificem/on-tasks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/VulpesArtificem/on-tasks/git/refs{/sha}","trees_url":"https://api.github.com/repos/VulpesArtificem/on-tasks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/VulpesArtificem/on-tasks/statuses/{sha}","languages_url":"https://api.github.com/repos/VulpesArtificem/on-tasks/languages","stargazers_url":"https://api.github.com/repos/VulpesArtificem/on-tasks/stargazers","contributors_url":"https://api.github.com/repos/VulpesArtificem/on-tasks/contributors","subscribers_url":"https://api.github.com/repos/VulpesArtificem/on-tasks/subscribers","subscription_url":"https://api.github.com/repos/VulpesArtificem/on-tasks/subscription","commits_url":"https://api.github.com/repos/VulpesArtificem/on-tasks/commits{/sha}","git_commits_url":"https://api.github.com/repos/VulpesArtificem/on-tasks/git/commits{/sha}","comments_url":"https://api.github.com/repos/VulpesArtificem/on-tasks/comments{/number}","issue_comment_url":"https://api.github.com/repos/VulpesArtificem/on-tasks/issues/comments{/number}","contents_url":"https://api.github.com/repos/VulpesArtificem/on-tasks/contents/{+path}","compare_url":"https://api.github.com/repos/VulpesArtificem/on-tasks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/VulpesArtificem/on-tasks/merges","archive_url":"https://api.github.com/repos/VulpesArtificem/on-tasks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/VulpesArtificem/on-tasks/downloads","issues_url":"https://api.github.com/repos/VulpesArtificem/on-tasks/issues{/number}","pulls_url":"https://api.github.com/repos/VulpesArtificem/on-tasks/pulls{/number}","milestones_url":"https://api.github.com/repos/VulpesArtificem/on-tasks/milestones{/number}","notifications_url":"https://api.github.com/repos/VulpesArtificem/on-tasks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/VulpesArtificem/on-tasks/labels{/name}","releases_url":"https://api.github.com/repos/VulpesArtificem/on-tasks/releases{/id}","deployments_url":"https://api.github.com/repos/VulpesArtificem/on-tasks/deployments","created_at":"2015-11-02T23:49:14Z","updated_at":"2015-11-02T23:49:16Z","pushed_at":"2016-04-21T16:53:51Z","git_url":"git://github.com/VulpesArtificem/on-tasks.git","ssh_url":"git@github.com:VulpesArtificem/on-tasks.git","clone_url":"https://github.com/VulpesArtificem/on-tasks.git","svn_url":"https://github.com/VulpesArtificem/on-tasks","homepage":null,"size":1282,"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":"dceac1db0d6c70984fca45469c9925852306c5d0","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-01-31T09:07:09Z","pushed_at":"2016-04-21T19:53:56Z","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":1295,"stargazers_count":6,"watchers_count":6,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":37,"mirror_url":null,"open_issues_count":5,"forks":37,"open_issues":5,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/RackHD/on-tasks/pulls/168"},"html":{"href":"https://github.com/RackHD/on-tasks/pull/168"},"issue":{"href":"https://api.github.com/repos/RackHD/on-tasks/issues/168"},"comments":{"href":"https://api.github.com/repos/RackHD/on-tasks/issues/168/comments"},"review_comments":{"href":"https://api.github.com/repos/RackHD/on-tasks/pulls/168/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/168/commits"},"statuses":{"href":"https://api.github.com/repos/RackHD/on-tasks/statuses/3e638ac950441bf5567c05ecd4d26f0315426248"}}}}