{"action":"created","comment":{"url":"https://api.github.com/repos/deis/controller/pulls/comments/61939982","id":61939982,"diff_hunk":"@@ -248,7 +248,7 @@ def test_passwd(self):\n         }\n         response = self.client.post(url, submit,\n                                     HTTP_AUTHORIZATION='token {}'.format(token))\n-        self.assertEqual(response.status_code, 400)\n+        self.assertEqual(response.status_code, 401)","path":"rootfs/api/tests/test_auth.py","position":5,"original_position":5,"commit_id":"0dfae6526aa6a9e1774b466c04182c48fb4bca39","original_commit_id":"0dfae6526aa6a9e1774b466c04182c48fb4bca39","user":{"login":"bacongobbler","id":1360539,"avatar_url":"https://avatars.githubusercontent.com/u/1360539?v=3","gravatar_id":"","url":"https://api.github.com/users/bacongobbler","html_url":"https://github.com/bacongobbler","followers_url":"https://api.github.com/users/bacongobbler/followers","following_url":"https://api.github.com/users/bacongobbler/following{/other_user}","gists_url":"https://api.github.com/users/bacongobbler/gists{/gist_id}","starred_url":"https://api.github.com/users/bacongobbler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bacongobbler/subscriptions","organizations_url":"https://api.github.com/users/bacongobbler/orgs","repos_url":"https://api.github.com/users/bacongobbler/repos","events_url":"https://api.github.com/users/bacongobbler/events{/privacy}","received_events_url":"https://api.github.com/users/bacongobbler/received_events","type":"User","site_admin":false},"body":"I'd try to keep the responses the same as they were before for compatibility's sake. Is there a specific reason why we want to change this from a 400 to a 401?","created_at":"2016-05-03T19:23:20Z","updated_at":"2016-05-03T19:23:20Z","html_url":"https://github.com/deis/controller/pull/702#discussion_r61939982","pull_request_url":"https://api.github.com/repos/deis/controller/pulls/702","_links":{"self":{"href":"https://api.github.com/repos/deis/controller/pulls/comments/61939982"},"html":{"href":"https://github.com/deis/controller/pull/702#discussion_r61939982"},"pull_request":{"href":"https://api.github.com/repos/deis/controller/pulls/702"}}},"pull_request":{"url":"https://api.github.com/repos/deis/controller/pulls/702","id":68756848,"html_url":"https://github.com/deis/controller/pull/702","diff_url":"https://github.com/deis/controller/pull/702.diff","patch_url":"https://github.com/deis/controller/pull/702.patch","issue_url":"https://api.github.com/repos/deis/controller/issues/702","number":702,"state":"open","locked":false,"title":"ref(models): use DRF APIException as a base for all exceptions","user":{"login":"helgi","id":70530,"avatar_url":"https://avatars.githubusercontent.com/u/70530?v=3","gravatar_id":"","url":"https://api.github.com/users/helgi","html_url":"https://github.com/helgi","followers_url":"https://api.github.com/users/helgi/followers","following_url":"https://api.github.com/users/helgi/following{/other_user}","gists_url":"https://api.github.com/users/helgi/gists{/gist_id}","starred_url":"https://api.github.com/users/helgi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/helgi/subscriptions","organizations_url":"https://api.github.com/users/helgi/orgs","repos_url":"https://api.github.com/users/helgi/repos","events_url":"https://api.github.com/users/helgi/events{/privacy}","received_events_url":"https://api.github.com/users/helgi/received_events","type":"User","site_admin":false},"body":"## Summary of Changes\r\n\r\nMove to using `DeisException` that extends `APIException` (with 400 as a status code) instead of `EnvironmentError`, have `AlreadyExists` extend `APIException` with 409 and `KubeException` and Logger related exceptions get raised up to the view as `ServiceUnavailable`\r\n\r\nAdditionally using `from e` when re-raising exception to keep contextual information if that is ever required (https://www.python.org/dev/peps/pep-3134/)\r\n\r\nhttps://github.com/tomchristie/django-rest-framework/blob/master/docs/api-guide/exceptions.md has further info on DRF exceptions\r\n\r\n## Issue(s) that this PR Closes\r\n\r\nref #612","created_at":"2016-05-03T18:58:37Z","updated_at":"2016-05-03T19:23:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"285352701563b160829fdc19c9a93d30bf384114","assignee":{"login":"helgi","id":70530,"avatar_url":"https://avatars.githubusercontent.com/u/70530?v=3","gravatar_id":"","url":"https://api.github.com/users/helgi","html_url":"https://github.com/helgi","followers_url":"https://api.github.com/users/helgi/followers","following_url":"https://api.github.com/users/helgi/following{/other_user}","gists_url":"https://api.github.com/users/helgi/gists{/gist_id}","starred_url":"https://api.github.com/users/helgi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/helgi/subscriptions","organizations_url":"https://api.github.com/users/helgi/orgs","repos_url":"https://api.github.com/users/helgi/repos","events_url":"https://api.github.com/users/helgi/events{/privacy}","received_events_url":"https://api.github.com/users/helgi/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/deis/controller/milestones/5","html_url":"https://github.com/deis/controller/milestones/v2.0-beta4","labels_url":"https://api.github.com/repos/deis/controller/milestones/5/labels","id":1682306,"number":5,"title":"v2.0-beta4","description":null,"creator":{"login":"slack","id":28873,"avatar_url":"https://avatars.githubusercontent.com/u/28873?v=3","gravatar_id":"","url":"https://api.github.com/users/slack","html_url":"https://github.com/slack","followers_url":"https://api.github.com/users/slack/followers","following_url":"https://api.github.com/users/slack/following{/other_user}","gists_url":"https://api.github.com/users/slack/gists{/gist_id}","starred_url":"https://api.github.com/users/slack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slack/subscriptions","organizations_url":"https://api.github.com/users/slack/orgs","repos_url":"https://api.github.com/users/slack/repos","events_url":"https://api.github.com/users/slack/events{/privacy}","received_events_url":"https://api.github.com/users/slack/received_events","type":"User","site_admin":false},"open_issues":25,"closed_issues":19,"state":"open","created_at":"2016-04-04T15:55:20Z","updated_at":"2016-05-03T18:58:37Z","due_on":"2016-05-11T07:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/deis/controller/pulls/702/commits","review_comments_url":"https://api.github.com/repos/deis/controller/pulls/702/comments","review_comment_url":"https://api.github.com/repos/deis/controller/pulls/comments{/number}","comments_url":"https://api.github.com/repos/deis/controller/issues/702/comments","statuses_url":"https://api.github.com/repos/deis/controller/statuses/0dfae6526aa6a9e1774b466c04182c48fb4bca39","head":{"label":"helgi:apps_coverage","ref":"apps_coverage","sha":"0dfae6526aa6a9e1774b466c04182c48fb4bca39","user":{"login":"helgi","id":70530,"avatar_url":"https://avatars.githubusercontent.com/u/70530?v=3","gravatar_id":"","url":"https://api.github.com/users/helgi","html_url":"https://github.com/helgi","followers_url":"https://api.github.com/users/helgi/followers","following_url":"https://api.github.com/users/helgi/following{/other_user}","gists_url":"https://api.github.com/users/helgi/gists{/gist_id}","starred_url":"https://api.github.com/users/helgi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/helgi/subscriptions","organizations_url":"https://api.github.com/users/helgi/orgs","repos_url":"https://api.github.com/users/helgi/repos","events_url":"https://api.github.com/users/helgi/events{/privacy}","received_events_url":"https://api.github.com/users/helgi/received_events","type":"User","site_admin":false},"repo":{"id":47214840,"name":"controller","full_name":"helgi/controller","owner":{"login":"helgi","id":70530,"avatar_url":"https://avatars.githubusercontent.com/u/70530?v=3","gravatar_id":"","url":"https://api.github.com/users/helgi","html_url":"https://github.com/helgi","followers_url":"https://api.github.com/users/helgi/followers","following_url":"https://api.github.com/users/helgi/following{/other_user}","gists_url":"https://api.github.com/users/helgi/gists{/gist_id}","starred_url":"https://api.github.com/users/helgi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/helgi/subscriptions","organizations_url":"https://api.github.com/users/helgi/orgs","repos_url":"https://api.github.com/users/helgi/repos","events_url":"https://api.github.com/users/helgi/events{/privacy}","received_events_url":"https://api.github.com/users/helgi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/helgi/controller","description":"PaaS workflow controller and client for Deis v2","fork":true,"url":"https://api.github.com/repos/helgi/controller","forks_url":"https://api.github.com/repos/helgi/controller/forks","keys_url":"https://api.github.com/repos/helgi/controller/keys{/key_id}","collaborators_url":"https://api.github.com/repos/helgi/controller/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/helgi/controller/teams","hooks_url":"https://api.github.com/repos/helgi/controller/hooks","issue_events_url":"https://api.github.com/repos/helgi/controller/issues/events{/number}","events_url":"https://api.github.com/repos/helgi/controller/events","assignees_url":"https://api.github.com/repos/helgi/controller/assignees{/user}","branches_url":"https://api.github.com/repos/helgi/controller/branches{/branch}","tags_url":"https://api.github.com/repos/helgi/controller/tags","blobs_url":"https://api.github.com/repos/helgi/controller/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/helgi/controller/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/helgi/controller/git/refs{/sha}","trees_url":"https://api.github.com/repos/helgi/controller/git/trees{/sha}","statuses_url":"https://api.github.com/repos/helgi/controller/statuses/{sha}","languages_url":"https://api.github.com/repos/helgi/controller/languages","stargazers_url":"https://api.github.com/repos/helgi/controller/stargazers","contributors_url":"https://api.github.com/repos/helgi/controller/contributors","subscribers_url":"https://api.github.com/repos/helgi/controller/subscribers","subscription_url":"https://api.github.com/repos/helgi/controller/subscription","commits_url":"https://api.github.com/repos/helgi/controller/commits{/sha}","git_commits_url":"https://api.github.com/repos/helgi/controller/git/commits{/sha}","comments_url":"https://api.github.com/repos/helgi/controller/comments{/number}","issue_comment_url":"https://api.github.com/repos/helgi/controller/issues/comments{/number}","contents_url":"https://api.github.com/repos/helgi/controller/contents/{+path}","compare_url":"https://api.github.com/repos/helgi/controller/compare/{base}...{head}","merges_url":"https://api.github.com/repos/helgi/controller/merges","archive_url":"https://api.github.com/repos/helgi/controller/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/helgi/controller/downloads","issues_url":"https://api.github.com/repos/helgi/controller/issues{/number}","pulls_url":"https://api.github.com/repos/helgi/controller/pulls{/number}","milestones_url":"https://api.github.com/repos/helgi/controller/milestones{/number}","notifications_url":"https://api.github.com/repos/helgi/controller/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/helgi/controller/labels{/name}","releases_url":"https://api.github.com/repos/helgi/controller/releases{/id}","deployments_url":"https://api.github.com/repos/helgi/controller/deployments","created_at":"2015-12-01T20:16:13Z","updated_at":"2016-03-16T17:43:06Z","pushed_at":"2016-05-03T18:57:33Z","git_url":"git://github.com/helgi/controller.git","ssh_url":"git@github.com:helgi/controller.git","clone_url":"https://github.com/helgi/controller.git","svn_url":"https://github.com/helgi/controller","homepage":"http://deis.io","size":15630,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"deis:master","ref":"master","sha":"9ca6db79ce4b61659f1d91a73440463d4d2115d4","user":{"login":"deis","id":6117407,"avatar_url":"https://avatars.githubusercontent.com/u/6117407?v=3","gravatar_id":"","url":"https://api.github.com/users/deis","html_url":"https://github.com/deis","followers_url":"https://api.github.com/users/deis/followers","following_url":"https://api.github.com/users/deis/following{/other_user}","gists_url":"https://api.github.com/users/deis/gists{/gist_id}","starred_url":"https://api.github.com/users/deis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deis/subscriptions","organizations_url":"https://api.github.com/users/deis/orgs","repos_url":"https://api.github.com/users/deis/repos","events_url":"https://api.github.com/users/deis/events{/privacy}","received_events_url":"https://api.github.com/users/deis/received_events","type":"Organization","site_admin":false},"repo":{"id":45704630,"name":"controller","full_name":"deis/controller","owner":{"login":"deis","id":6117407,"avatar_url":"https://avatars.githubusercontent.com/u/6117407?v=3","gravatar_id":"","url":"https://api.github.com/users/deis","html_url":"https://github.com/deis","followers_url":"https://api.github.com/users/deis/followers","following_url":"https://api.github.com/users/deis/following{/other_user}","gists_url":"https://api.github.com/users/deis/gists{/gist_id}","starred_url":"https://api.github.com/users/deis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deis/subscriptions","organizations_url":"https://api.github.com/users/deis/orgs","repos_url":"https://api.github.com/users/deis/repos","events_url":"https://api.github.com/users/deis/events{/privacy}","received_events_url":"https://api.github.com/users/deis/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/deis/controller","description":"Deis Workflow Controller (API)","fork":false,"url":"https://api.github.com/repos/deis/controller","forks_url":"https://api.github.com/repos/deis/controller/forks","keys_url":"https://api.github.com/repos/deis/controller/keys{/key_id}","collaborators_url":"https://api.github.com/repos/deis/controller/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/deis/controller/teams","hooks_url":"https://api.github.com/repos/deis/controller/hooks","issue_events_url":"https://api.github.com/repos/deis/controller/issues/events{/number}","events_url":"https://api.github.com/repos/deis/controller/events","assignees_url":"https://api.github.com/repos/deis/controller/assignees{/user}","branches_url":"https://api.github.com/repos/deis/controller/branches{/branch}","tags_url":"https://api.github.com/repos/deis/controller/tags","blobs_url":"https://api.github.com/repos/deis/controller/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/deis/controller/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/deis/controller/git/refs{/sha}","trees_url":"https://api.github.com/repos/deis/controller/git/trees{/sha}","statuses_url":"https://api.github.com/repos/deis/controller/statuses/{sha}","languages_url":"https://api.github.com/repos/deis/controller/languages","stargazers_url":"https://api.github.com/repos/deis/controller/stargazers","contributors_url":"https://api.github.com/repos/deis/controller/contributors","subscribers_url":"https://api.github.com/repos/deis/controller/subscribers","subscription_url":"https://api.github.com/repos/deis/controller/subscription","commits_url":"https://api.github.com/repos/deis/controller/commits{/sha}","git_commits_url":"https://api.github.com/repos/deis/controller/git/commits{/sha}","comments_url":"https://api.github.com/repos/deis/controller/comments{/number}","issue_comment_url":"https://api.github.com/repos/deis/controller/issues/comments{/number}","contents_url":"https://api.github.com/repos/deis/controller/contents/{+path}","compare_url":"https://api.github.com/repos/deis/controller/compare/{base}...{head}","merges_url":"https://api.github.com/repos/deis/controller/merges","archive_url":"https://api.github.com/repos/deis/controller/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/deis/controller/downloads","issues_url":"https://api.github.com/repos/deis/controller/issues{/number}","pulls_url":"https://api.github.com/repos/deis/controller/pulls{/number}","milestones_url":"https://api.github.com/repos/deis/controller/milestones{/number}","notifications_url":"https://api.github.com/repos/deis/controller/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/deis/controller/labels{/name}","releases_url":"https://api.github.com/repos/deis/controller/releases{/id}","deployments_url":"https://api.github.com/repos/deis/controller/deployments","created_at":"2015-11-06T20:06:05Z","updated_at":"2016-04-17T20:29:59Z","pushed_at":"2016-05-03T18:58:37Z","git_url":"git://github.com/deis/controller.git","ssh_url":"git@github.com:deis/controller.git","clone_url":"https://github.com/deis/controller.git","svn_url":"https://github.com/deis/controller","homepage":"https://deis.com","size":16671,"stargazers_count":20,"watchers_count":20,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":22,"mirror_url":null,"open_issues_count":70,"forks":22,"open_issues":70,"watchers":20,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/deis/controller/pulls/702"},"html":{"href":"https://github.com/deis/controller/pull/702"},"issue":{"href":"https://api.github.com/repos/deis/controller/issues/702"},"comments":{"href":"https://api.github.com/repos/deis/controller/issues/702/comments"},"review_comments":{"href":"https://api.github.com/repos/deis/controller/pulls/702/comments"},"review_comment":{"href":"https://api.github.com/repos/deis/controller/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/deis/controller/pulls/702/commits"},"statuses":{"href":"https://api.github.com/repos/deis/controller/statuses/0dfae6526aa6a9e1774b466c04182c48fb4bca39"}}}}