{"action":"created","comment":{"url":"https://api.github.com/repos/RackHD/on-core/pulls/comments/63588314","id":63588314,"diff_hunk":"@@ -210,6 +210,45 @@ describe('Models.Lookup', function () {\n             });\n         });\n \n+        describe('upsertProxyToMacAddress', function () {\n+            it('should update an existing record by mac adddress', function() {\n+                var record = {\n+                    id: 'id',\n+                    macAddress: 'macAddress',\n+                    ipAddress: 'ipAddress',\n+                    node: 'node',\n+                    proxy: 'proxy'\n+                },\n+                update = this.sandbox.stub(waterline.lookups, 'update').resolves([record]),\n+                findOne = this.sandbox.stub(waterline.lookups, 'findOne').resolves(record);\n+\n+                return waterline.lookups.upsertProxyToMacAddress(\n+                    'proxy',\n+                    'macAddress'\n+                ).then(function () {\n+                    expect(findOne).to.have.been.calledWith({ macAddress: 'macAddress' });\n+                    expect(update).to.have.been.calledWith({ id: 'id' }, { proxy: 'proxy' });\n+                });\n+            });\n+\n+            it('should be rejected with Errors.NotFoundError no record is returned by find', function() {","path":"spec/lib/models/lookup-spec.js","position":25,"original_position":25,"commit_id":"51dd38ecbd367f764680140a46bee8ea96fbb2ca","original_commit_id":"51dd38ecbd367f764680140a46bee8ea96fbb2ca","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 is too long.","created_at":"2016-05-17T19:31:49Z","updated_at":"2016-05-17T19:31:49Z","html_url":"https://github.com/RackHD/on-core/pull/131#discussion_r63588314","pull_request_url":"https://api.github.com/repos/RackHD/on-core/pulls/131","_links":{"self":{"href":"https://api.github.com/repos/RackHD/on-core/pulls/comments/63588314"},"html":{"href":"https://github.com/RackHD/on-core/pull/131#discussion_r63588314"},"pull_request":{"href":"https://api.github.com/repos/RackHD/on-core/pulls/131"}}},"pull_request":{"url":"https://api.github.com/repos/RackHD/on-core/pulls/131","id":69368178,"html_url":"https://github.com/RackHD/on-core/pull/131","diff_url":"https://github.com/RackHD/on-core/pull/131.diff","patch_url":"https://github.com/RackHD/on-core/pull/131.patch","issue_url":"https://api.github.com/repos/RackHD/on-core/issues/131","number":131,"state":"open","locked":false,"title":"Add support for southbound API proxy server","user":{"login":"shanemsully","id":17908424,"avatar_url":"https://avatars.githubusercontent.com/u/17908424?v=3","gravatar_id":"","url":"https://api.github.com/users/shanemsully","html_url":"https://github.com/shanemsully","followers_url":"https://api.github.com/users/shanemsully/followers","following_url":"https://api.github.com/users/shanemsully/following{/other_user}","gists_url":"https://api.github.com/users/shanemsully/gists{/gist_id}","starred_url":"https://api.github.com/users/shanemsully/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shanemsully/subscriptions","organizations_url":"https://api.github.com/users/shanemsully/orgs","repos_url":"https://api.github.com/users/shanemsully/repos","events_url":"https://api.github.com/users/shanemsully/events{/privacy}","received_events_url":"https://api.github.com/users/shanemsully/received_events","type":"User","site_admin":false},"body":"In order to support running the RackHD on-taskgraph and on-http services on a host that does not have Layer-2 network access to the PXE network we need a host that does have access to the PXE network and can proxy requests to the southbound API endpoint over a management network.  \r\n\r\nThe proxy server, nginx in my POC, adds headers to the requests coming from the PXE client that contain headers that will be used during profile, template, and task rendering.\r\n\r\nThe headers are\r\nX-Real-IP - the actual IP address of the PXE client\r\nX-RackHD-api-proxy-ip - The IP address of the API proxy server\r\nX-RackHD-api-proxy-port - The port of the API proxy server\r\n\r\nThe proxy server URL is added to the lookup record for the PXE client so that it can be used during task rendering since the original HTTP request is not available at that time.\r\n\r\non-http PR: https://github.com/RackHD/on-http/pull/274\r\non-tasks PR: https://github.com/RackHD/on-tasks/pull/185\r\n\r\nThis is one of three pull requests.  There will also be subsequent changes to on-http and on-tasks to support this.\r\n[test-coverage.tar.gz](https://github.com/RackHD/on-core/files/255346/test-coverage.tar.gz)\r\n\r\n\r\n","created_at":"2016-05-09T15:56:54Z","updated_at":"2016-05-17T19:31:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"574f30982bc6838be435885dae3a112d41a0e04e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/RackHD/on-core/pulls/131/commits","review_comments_url":"https://api.github.com/repos/RackHD/on-core/pulls/131/comments","review_comment_url":"https://api.github.com/repos/RackHD/on-core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/RackHD/on-core/issues/131/comments","statuses_url":"https://api.github.com/repos/RackHD/on-core/statuses/51dd38ecbd367f764680140a46bee8ea96fbb2ca","head":{"label":"shanemsully:http-proxy","ref":"http-proxy","sha":"51dd38ecbd367f764680140a46bee8ea96fbb2ca","user":{"login":"shanemsully","id":17908424,"avatar_url":"https://avatars.githubusercontent.com/u/17908424?v=3","gravatar_id":"","url":"https://api.github.com/users/shanemsully","html_url":"https://github.com/shanemsully","followers_url":"https://api.github.com/users/shanemsully/followers","following_url":"https://api.github.com/users/shanemsully/following{/other_user}","gists_url":"https://api.github.com/users/shanemsully/gists{/gist_id}","starred_url":"https://api.github.com/users/shanemsully/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shanemsully/subscriptions","organizations_url":"https://api.github.com/users/shanemsully/orgs","repos_url":"https://api.github.com/users/shanemsully/repos","events_url":"https://api.github.com/users/shanemsully/events{/privacy}","received_events_url":"https://api.github.com/users/shanemsully/received_events","type":"User","site_admin":false},"repo":{"id":57409728,"name":"on-core","full_name":"shanemsully/on-core","owner":{"login":"shanemsully","id":17908424,"avatar_url":"https://avatars.githubusercontent.com/u/17908424?v=3","gravatar_id":"","url":"https://api.github.com/users/shanemsully","html_url":"https://github.com/shanemsully","followers_url":"https://api.github.com/users/shanemsully/followers","following_url":"https://api.github.com/users/shanemsully/following{/other_user}","gists_url":"https://api.github.com/users/shanemsully/gists{/gist_id}","starred_url":"https://api.github.com/users/shanemsully/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shanemsully/subscriptions","organizations_url":"https://api.github.com/users/shanemsully/orgs","repos_url":"https://api.github.com/users/shanemsully/repos","events_url":"https://api.github.com/users/shanemsully/events{/privacy}","received_events_url":"https://api.github.com/users/shanemsully/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/shanemsully/on-core","description":"","fork":true,"url":"https://api.github.com/repos/shanemsully/on-core","forks_url":"https://api.github.com/repos/shanemsully/on-core/forks","keys_url":"https://api.github.com/repos/shanemsully/on-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shanemsully/on-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shanemsully/on-core/teams","hooks_url":"https://api.github.com/repos/shanemsully/on-core/hooks","issue_events_url":"https://api.github.com/repos/shanemsully/on-core/issues/events{/number}","events_url":"https://api.github.com/repos/shanemsully/on-core/events","assignees_url":"https://api.github.com/repos/shanemsully/on-core/assignees{/user}","branches_url":"https://api.github.com/repos/shanemsully/on-core/branches{/branch}","tags_url":"https://api.github.com/repos/shanemsully/on-core/tags","blobs_url":"https://api.github.com/repos/shanemsully/on-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shanemsully/on-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shanemsully/on-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/shanemsully/on-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shanemsully/on-core/statuses/{sha}","languages_url":"https://api.github.com/repos/shanemsully/on-core/languages","stargazers_url":"https://api.github.com/repos/shanemsully/on-core/stargazers","contributors_url":"https://api.github.com/repos/shanemsully/on-core/contributors","subscribers_url":"https://api.github.com/repos/shanemsully/on-core/subscribers","subscription_url":"https://api.github.com/repos/shanemsully/on-core/subscription","commits_url":"https://api.github.com/repos/shanemsully/on-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/shanemsully/on-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/shanemsully/on-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/shanemsully/on-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/shanemsully/on-core/contents/{+path}","compare_url":"https://api.github.com/repos/shanemsully/on-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shanemsully/on-core/merges","archive_url":"https://api.github.com/repos/shanemsully/on-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shanemsully/on-core/downloads","issues_url":"https://api.github.com/repos/shanemsully/on-core/issues{/number}","pulls_url":"https://api.github.com/repos/shanemsully/on-core/pulls{/number}","milestones_url":"https://api.github.com/repos/shanemsully/on-core/milestones{/number}","notifications_url":"https://api.github.com/repos/shanemsully/on-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shanemsully/on-core/labels{/name}","releases_url":"https://api.github.com/repos/shanemsully/on-core/releases{/id}","deployments_url":"https://api.github.com/repos/shanemsully/on-core/deployments","created_at":"2016-04-29T20:02:04Z","updated_at":"2016-04-29T20:02:05Z","pushed_at":"2016-05-17T19:31:30Z","git_url":"git://github.com/shanemsully/on-core.git","ssh_url":"git@github.com:shanemsully/on-core.git","clone_url":"https://github.com/shanemsully/on-core.git","svn_url":"https://github.com/shanemsully/on-core","homepage":null,"size":973,"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":"f416b4755b6d5de4e3dce09382d15ea9e5c44f34","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":41690044,"name":"on-core","full_name":"RackHD/on-core","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-core","description":"","fork":false,"url":"https://api.github.com/repos/RackHD/on-core","forks_url":"https://api.github.com/repos/RackHD/on-core/forks","keys_url":"https://api.github.com/repos/RackHD/on-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/RackHD/on-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/RackHD/on-core/teams","hooks_url":"https://api.github.com/repos/RackHD/on-core/hooks","issue_events_url":"https://api.github.com/repos/RackHD/on-core/issues/events{/number}","events_url":"https://api.github.com/repos/RackHD/on-core/events","assignees_url":"https://api.github.com/repos/RackHD/on-core/assignees{/user}","branches_url":"https://api.github.com/repos/RackHD/on-core/branches{/branch}","tags_url":"https://api.github.com/repos/RackHD/on-core/tags","blobs_url":"https://api.github.com/repos/RackHD/on-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/RackHD/on-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/RackHD/on-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/RackHD/on-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/RackHD/on-core/statuses/{sha}","languages_url":"https://api.github.com/repos/RackHD/on-core/languages","stargazers_url":"https://api.github.com/repos/RackHD/on-core/stargazers","contributors_url":"https://api.github.com/repos/RackHD/on-core/contributors","subscribers_url":"https://api.github.com/repos/RackHD/on-core/subscribers","subscription_url":"https://api.github.com/repos/RackHD/on-core/subscription","commits_url":"https://api.github.com/repos/RackHD/on-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/RackHD/on-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/RackHD/on-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/RackHD/on-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/RackHD/on-core/contents/{+path}","compare_url":"https://api.github.com/repos/RackHD/on-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/RackHD/on-core/merges","archive_url":"https://api.github.com/repos/RackHD/on-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/RackHD/on-core/downloads","issues_url":"https://api.github.com/repos/RackHD/on-core/issues{/number}","pulls_url":"https://api.github.com/repos/RackHD/on-core/pulls{/number}","milestones_url":"https://api.github.com/repos/RackHD/on-core/milestones{/number}","notifications_url":"https://api.github.com/repos/RackHD/on-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/RackHD/on-core/labels{/name}","releases_url":"https://api.github.com/repos/RackHD/on-core/releases{/id}","deployments_url":"https://api.github.com/repos/RackHD/on-core/deployments","created_at":"2015-08-31T17:28:32Z","updated_at":"2016-01-31T09:01:09Z","pushed_at":"2016-05-17T19:31:30Z","git_url":"git://github.com/RackHD/on-core.git","ssh_url":"git@github.com:RackHD/on-core.git","clone_url":"https://github.com/RackHD/on-core.git","svn_url":"https://github.com/RackHD/on-core","homepage":null,"size":1021,"stargazers_count":9,"watchers_count":9,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":32,"mirror_url":null,"open_issues_count":6,"forks":32,"open_issues":6,"watchers":9,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/RackHD/on-core/pulls/131"},"html":{"href":"https://github.com/RackHD/on-core/pull/131"},"issue":{"href":"https://api.github.com/repos/RackHD/on-core/issues/131"},"comments":{"href":"https://api.github.com/repos/RackHD/on-core/issues/131/comments"},"review_comments":{"href":"https://api.github.com/repos/RackHD/on-core/pulls/131/comments"},"review_comment":{"href":"https://api.github.com/repos/RackHD/on-core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/RackHD/on-core/pulls/131/commits"},"statuses":{"href":"https://api.github.com/repos/RackHD/on-core/statuses/51dd38ecbd367f764680140a46bee8ea96fbb2ca"}}}}