{"action":"created","comment":{"url":"https://api.github.com/repos/rackerlabs/mimic/pulls/comments/30367966","id":30367966,"diff_hunk":"@@ -447,23 +507,29 @@ def create_success_report_failure_behavior(parameters):\n     Create a behavior that reports failure, but actually succeeds, for server\n     creation.\n \n-    Takes two parameters:\n+    Takes three parameters:\n \n     ``\"code\"``, an integer describing the HTTP response code, and\n     ``\"message\"``, a string describing a textual message.\n+    ``\"type\"``, a string representing what type of error message it is\n \n-    The response body will be a JSON object including ``code`` and ``message``\n-    fields matching the parameters.\n-    \"\"\"\n-    status_code = parameters.get(\"code\", 500)\n-    failure_message = parameters.get(\"message\", \"Server creation failed.\")\n+    If ``type`` is \"string\", the message is just returned as the string body.\n+    Otherwise, the following JSON body will be synthesized (as per the\n+    canonical Nova error format):\n \n-    def create_then_fail(collection, http, json, absolutize_url):\n-        Server.from_creation_request_json(\n-            collection, json, lambda: randrange(255))\n-        http.setResponseCode(status_code)\n-        return dumps(invalid_resource(failure_message, status_code))\n-    return create_then_fail\n+    ```","path":"mimic/model/nova_objects.py","position":134,"original_position":134,"commit_id":"372d0b33d2f4727059ba33ddc177c9c9c41a4f30","original_commit_id":"372d0b33d2f4727059ba33ddc177c9c9c41a4f30","user":{"login":"glyph","id":716529,"avatar_url":"https://avatars.githubusercontent.com/u/716529?v=3","gravatar_id":"","url":"https://api.github.com/users/glyph","html_url":"https://github.com/glyph","followers_url":"https://api.github.com/users/glyph/followers","following_url":"https://api.github.com/users/glyph/following{/other_user}","gists_url":"https://api.github.com/users/glyph/gists{/gist_id}","starred_url":"https://api.github.com/users/glyph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/glyph/subscriptions","organizations_url":"https://api.github.com/users/glyph/orgs","repos_url":"https://api.github.com/users/glyph/repos","events_url":"https://api.github.com/users/glyph/events{/privacy}","received_events_url":"https://api.github.com/users/glyph/received_events","type":"User","site_admin":false},"body":"We should probably have a docstring linter.  I guess we already do in some sense, but there are very few things that are outright *errors* in ReST, just lots of things that format horribly. I don't think we have any online generation of docs I could point to to see how this formatted.","created_at":"2015-05-14T22:00:07Z","updated_at":"2015-05-14T22:00:07Z","html_url":"https://github.com/rackerlabs/mimic/pull/263#discussion_r30367966","pull_request_url":"https://api.github.com/repos/rackerlabs/mimic/pulls/263","_links":{"self":{"href":"https://api.github.com/repos/rackerlabs/mimic/pulls/comments/30367966"},"html":{"href":"https://github.com/rackerlabs/mimic/pull/263#discussion_r30367966"},"pull_request":{"href":"https://api.github.com/repos/rackerlabs/mimic/pulls/263"}}},"pull_request":{"url":"https://api.github.com/repos/rackerlabs/mimic/pulls/263","id":35260236,"html_url":"https://github.com/rackerlabs/mimic/pull/263","diff_url":"https://github.com/rackerlabs/mimic/pull/263.diff","patch_url":"https://github.com/rackerlabs/mimic/pull/263.patch","issue_url":"https://api.github.com/repos/rackerlabs/mimic/issues/263","number":263,"state":"open","locked":false,"title":"Adjust failure on create behaviors","user":{"login":"cyli","id":223200,"avatar_url":"https://avatars.githubusercontent.com/u/223200?v=3","gravatar_id":"","url":"https://api.github.com/users/cyli","html_url":"https://github.com/cyli","followers_url":"https://api.github.com/users/cyli/followers","following_url":"https://api.github.com/users/cyli/following{/other_user}","gists_url":"https://api.github.com/users/cyli/gists{/gist_id}","starred_url":"https://api.github.com/users/cyli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cyli/subscriptions","organizations_url":"https://api.github.com/users/cyli/orgs","repos_url":"https://api.github.com/users/cyli/repos","events_url":"https://api.github.com/users/cyli/events{/privacy}","received_events_url":"https://api.github.com/users/cyli/received_events","type":"User","site_admin":false},"body":"1. The JSON blob passed back wasn't really a canonical Nova error, which has the type of failure in it.\r\n2. We sometimes want to inject non-JSON errors.  For example: `403 Forbidden\\\\n\\\\nAccess was denied to this resource.\\\\n\\\\n Networks (00000000-0000-0000-0000-000000000000,11111111-1111-1111-1111-111111111111) required but missing` is an error we've seen.","created_at":"2015-05-12T19:13:26Z","updated_at":"2015-05-14T22:00:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8ff2f80c6d6489a3e440992f7db4bbd5be9e6b88","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/rackerlabs/mimic/pulls/263/commits","review_comments_url":"https://api.github.com/repos/rackerlabs/mimic/pulls/263/comments","review_comment_url":"https://api.github.com/repos/rackerlabs/mimic/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rackerlabs/mimic/issues/263/comments","statuses_url":"https://api.github.com/repos/rackerlabs/mimic/statuses/372d0b33d2f4727059ba33ddc177c9c9c41a4f30","head":{"label":"rackerlabs:string-failure-injection","ref":"string-failure-injection","sha":"372d0b33d2f4727059ba33ddc177c9c9c41a4f30","user":{"login":"rackerlabs","id":84293,"avatar_url":"https://avatars.githubusercontent.com/u/84293?v=3","gravatar_id":"","url":"https://api.github.com/users/rackerlabs","html_url":"https://github.com/rackerlabs","followers_url":"https://api.github.com/users/rackerlabs/followers","following_url":"https://api.github.com/users/rackerlabs/following{/other_user}","gists_url":"https://api.github.com/users/rackerlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/rackerlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rackerlabs/subscriptions","organizations_url":"https://api.github.com/users/rackerlabs/orgs","repos_url":"https://api.github.com/users/rackerlabs/repos","events_url":"https://api.github.com/users/rackerlabs/events{/privacy}","received_events_url":"https://api.github.com/users/rackerlabs/received_events","type":"Organization","site_admin":false},"repo":{"id":13158707,"name":"mimic","full_name":"rackerlabs/mimic","owner":{"login":"rackerlabs","id":84293,"avatar_url":"https://avatars.githubusercontent.com/u/84293?v=3","gravatar_id":"","url":"https://api.github.com/users/rackerlabs","html_url":"https://github.com/rackerlabs","followers_url":"https://api.github.com/users/rackerlabs/followers","following_url":"https://api.github.com/users/rackerlabs/following{/other_user}","gists_url":"https://api.github.com/users/rackerlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/rackerlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rackerlabs/subscriptions","organizations_url":"https://api.github.com/users/rackerlabs/orgs","repos_url":"https://api.github.com/users/rackerlabs/repos","events_url":"https://api.github.com/users/rackerlabs/events{/privacy}","received_events_url":"https://api.github.com/users/rackerlabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rackerlabs/mimic","description":"An API mock service","fork":false,"url":"https://api.github.com/repos/rackerlabs/mimic","forks_url":"https://api.github.com/repos/rackerlabs/mimic/forks","keys_url":"https://api.github.com/repos/rackerlabs/mimic/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rackerlabs/mimic/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rackerlabs/mimic/teams","hooks_url":"https://api.github.com/repos/rackerlabs/mimic/hooks","issue_events_url":"https://api.github.com/repos/rackerlabs/mimic/issues/events{/number}","events_url":"https://api.github.com/repos/rackerlabs/mimic/events","assignees_url":"https://api.github.com/repos/rackerlabs/mimic/assignees{/user}","branches_url":"https://api.github.com/repos/rackerlabs/mimic/branches{/branch}","tags_url":"https://api.github.com/repos/rackerlabs/mimic/tags","blobs_url":"https://api.github.com/repos/rackerlabs/mimic/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rackerlabs/mimic/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rackerlabs/mimic/git/refs{/sha}","trees_url":"https://api.github.com/repos/rackerlabs/mimic/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rackerlabs/mimic/statuses/{sha}","languages_url":"https://api.github.com/repos/rackerlabs/mimic/languages","stargazers_url":"https://api.github.com/repos/rackerlabs/mimic/stargazers","contributors_url":"https://api.github.com/repos/rackerlabs/mimic/contributors","subscribers_url":"https://api.github.com/repos/rackerlabs/mimic/subscribers","subscription_url":"https://api.github.com/repos/rackerlabs/mimic/subscription","commits_url":"https://api.github.com/repos/rackerlabs/mimic/commits{/sha}","git_commits_url":"https://api.github.com/repos/rackerlabs/mimic/git/commits{/sha}","comments_url":"https://api.github.com/repos/rackerlabs/mimic/comments{/number}","issue_comment_url":"https://api.github.com/repos/rackerlabs/mimic/issues/comments{/number}","contents_url":"https://api.github.com/repos/rackerlabs/mimic/contents/{+path}","compare_url":"https://api.github.com/repos/rackerlabs/mimic/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rackerlabs/mimic/merges","archive_url":"https://api.github.com/repos/rackerlabs/mimic/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rackerlabs/mimic/downloads","issues_url":"https://api.github.com/repos/rackerlabs/mimic/issues{/number}","pulls_url":"https://api.github.com/repos/rackerlabs/mimic/pulls{/number}","milestones_url":"https://api.github.com/repos/rackerlabs/mimic/milestones{/number}","notifications_url":"https://api.github.com/repos/rackerlabs/mimic/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rackerlabs/mimic/labels{/name}","releases_url":"https://api.github.com/repos/rackerlabs/mimic/releases{/id}","created_at":"2013-09-27T19:01:16Z","updated_at":"2015-05-12T17:07:50Z","pushed_at":"2015-05-14T21:19:53Z","git_url":"git://github.com/rackerlabs/mimic.git","ssh_url":"git@github.com:rackerlabs/mimic.git","clone_url":"https://github.com/rackerlabs/mimic.git","svn_url":"https://github.com/rackerlabs/mimic","homepage":"","size":5275,"stargazers_count":82,"watchers_count":82,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":42,"mirror_url":null,"open_issues_count":63,"forks":42,"open_issues":63,"watchers":82,"default_branch":"master"}},"base":{"label":"rackerlabs:master","ref":"master","sha":"71b4761a01147cdbdf6a88462cdbbe11f393570c","user":{"login":"rackerlabs","id":84293,"avatar_url":"https://avatars.githubusercontent.com/u/84293?v=3","gravatar_id":"","url":"https://api.github.com/users/rackerlabs","html_url":"https://github.com/rackerlabs","followers_url":"https://api.github.com/users/rackerlabs/followers","following_url":"https://api.github.com/users/rackerlabs/following{/other_user}","gists_url":"https://api.github.com/users/rackerlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/rackerlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rackerlabs/subscriptions","organizations_url":"https://api.github.com/users/rackerlabs/orgs","repos_url":"https://api.github.com/users/rackerlabs/repos","events_url":"https://api.github.com/users/rackerlabs/events{/privacy}","received_events_url":"https://api.github.com/users/rackerlabs/received_events","type":"Organization","site_admin":false},"repo":{"id":13158707,"name":"mimic","full_name":"rackerlabs/mimic","owner":{"login":"rackerlabs","id":84293,"avatar_url":"https://avatars.githubusercontent.com/u/84293?v=3","gravatar_id":"","url":"https://api.github.com/users/rackerlabs","html_url":"https://github.com/rackerlabs","followers_url":"https://api.github.com/users/rackerlabs/followers","following_url":"https://api.github.com/users/rackerlabs/following{/other_user}","gists_url":"https://api.github.com/users/rackerlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/rackerlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rackerlabs/subscriptions","organizations_url":"https://api.github.com/users/rackerlabs/orgs","repos_url":"https://api.github.com/users/rackerlabs/repos","events_url":"https://api.github.com/users/rackerlabs/events{/privacy}","received_events_url":"https://api.github.com/users/rackerlabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rackerlabs/mimic","description":"An API mock service","fork":false,"url":"https://api.github.com/repos/rackerlabs/mimic","forks_url":"https://api.github.com/repos/rackerlabs/mimic/forks","keys_url":"https://api.github.com/repos/rackerlabs/mimic/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rackerlabs/mimic/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rackerlabs/mimic/teams","hooks_url":"https://api.github.com/repos/rackerlabs/mimic/hooks","issue_events_url":"https://api.github.com/repos/rackerlabs/mimic/issues/events{/number}","events_url":"https://api.github.com/repos/rackerlabs/mimic/events","assignees_url":"https://api.github.com/repos/rackerlabs/mimic/assignees{/user}","branches_url":"https://api.github.com/repos/rackerlabs/mimic/branches{/branch}","tags_url":"https://api.github.com/repos/rackerlabs/mimic/tags","blobs_url":"https://api.github.com/repos/rackerlabs/mimic/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rackerlabs/mimic/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rackerlabs/mimic/git/refs{/sha}","trees_url":"https://api.github.com/repos/rackerlabs/mimic/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rackerlabs/mimic/statuses/{sha}","languages_url":"https://api.github.com/repos/rackerlabs/mimic/languages","stargazers_url":"https://api.github.com/repos/rackerlabs/mimic/stargazers","contributors_url":"https://api.github.com/repos/rackerlabs/mimic/contributors","subscribers_url":"https://api.github.com/repos/rackerlabs/mimic/subscribers","subscription_url":"https://api.github.com/repos/rackerlabs/mimic/subscription","commits_url":"https://api.github.com/repos/rackerlabs/mimic/commits{/sha}","git_commits_url":"https://api.github.com/repos/rackerlabs/mimic/git/commits{/sha}","comments_url":"https://api.github.com/repos/rackerlabs/mimic/comments{/number}","issue_comment_url":"https://api.github.com/repos/rackerlabs/mimic/issues/comments{/number}","contents_url":"https://api.github.com/repos/rackerlabs/mimic/contents/{+path}","compare_url":"https://api.github.com/repos/rackerlabs/mimic/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rackerlabs/mimic/merges","archive_url":"https://api.github.com/repos/rackerlabs/mimic/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rackerlabs/mimic/downloads","issues_url":"https://api.github.com/repos/rackerlabs/mimic/issues{/number}","pulls_url":"https://api.github.com/repos/rackerlabs/mimic/pulls{/number}","milestones_url":"https://api.github.com/repos/rackerlabs/mimic/milestones{/number}","notifications_url":"https://api.github.com/repos/rackerlabs/mimic/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rackerlabs/mimic/labels{/name}","releases_url":"https://api.github.com/repos/rackerlabs/mimic/releases{/id}","created_at":"2013-09-27T19:01:16Z","updated_at":"2015-05-12T17:07:50Z","pushed_at":"2015-05-14T21:19:53Z","git_url":"git://github.com/rackerlabs/mimic.git","ssh_url":"git@github.com:rackerlabs/mimic.git","clone_url":"https://github.com/rackerlabs/mimic.git","svn_url":"https://github.com/rackerlabs/mimic","homepage":"","size":5275,"stargazers_count":82,"watchers_count":82,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":42,"mirror_url":null,"open_issues_count":63,"forks":42,"open_issues":63,"watchers":82,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rackerlabs/mimic/pulls/263"},"html":{"href":"https://github.com/rackerlabs/mimic/pull/263"},"issue":{"href":"https://api.github.com/repos/rackerlabs/mimic/issues/263"},"comments":{"href":"https://api.github.com/repos/rackerlabs/mimic/issues/263/comments"},"review_comments":{"href":"https://api.github.com/repos/rackerlabs/mimic/pulls/263/comments"},"review_comment":{"href":"https://api.github.com/repos/rackerlabs/mimic/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rackerlabs/mimic/pulls/263/commits"},"statuses":{"href":"https://api.github.com/repos/rackerlabs/mimic/statuses/372d0b33d2f4727059ba33ddc177c9c9c41a4f30"}}}}