)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"667c6787f3c7dfc25f1e9d7f76071e02ebe6f033","unresolved":false,"context_lines":[{"line_number":31,"context_line":"that environ is set in json_error_formatter, we can set \u0027code\u0027 in the"},{"line_number":32,"context_line":"output."},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"This is done in a new microversion, 1.19. Every response gets a default"},{"line_number":35,"context_line":"code \u0027placement.undefined_code\u0027 from 1.19 on. Future development will"},{"line_number":36,"context_line":"add specific codes where required. This change adds a stub code for"},{"line_number":37,"context_line":"inventory in use when doing a PUT to .../inventories but the name"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"df7087c5_1f5acb82","line":34,"range":{"start_line":34,"start_character":36,"end_line":34,"end_character":40},"updated":"2018-03-16 22:32:48.000000000","message":"not anymore","commit_id":"cabb3dedc32465e7ba84c4267c6bb6bff8f49c20"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"667c6787f3c7dfc25f1e9d7f76071e02ebe6f033","unresolved":false,"context_lines":[{"line_number":32,"context_line":"output."},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"This is done in a new microversion, 1.19. Every response gets a default"},{"line_number":35,"context_line":"code \u0027placement.undefined_code\u0027 from 1.19 on. Future development will"},{"line_number":36,"context_line":"add specific codes where required. This change adds a stub code for"},{"line_number":37,"context_line":"inventory in use when doing a PUT to .../inventories but the name"},{"line_number":38,"context_line":"probably needs some improvement."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"df7087c5_df53f36b","line":35,"range":{"start_line":35,"start_character":37,"end_line":35,"end_character":41},"updated":"2018-03-16 22:32:48.000000000","message":"ditto.","commit_id":"cabb3dedc32465e7ba84c4267c6bb6bff8f49c20"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"667c6787f3c7dfc25f1e9d7f76071e02ebe6f033","unresolved":false,"context_lines":[{"line_number":44,"context_line":""},{"line_number":45,"context_line":"[1] http://specs.openstack.org/openstack/api-wg/guidelines/errors.html"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"Implements blueprint placement-api-error-handling"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"Change-Id: I9a833aa35d474caa35e640bbad6c436a3b16ac5e"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"df7087c5_3fed4f8b","line":47,"range":{"start_line":47,"start_character":21,"end_line":47,"end_character":49},"updated":"2018-03-16 22:32:48.000000000","message":"This doesn\u0027t seem to be a real blueprint.  And I couldn\u0027t find the right one.  Which is weird, because I coulda sworn I remembered reading the spec.  I must be getting old.","commit_id":"cabb3dedc32465e7ba84c4267c6bb6bff8f49c20"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"2cbb21967766b7183e33286ffa77708d9c1f6a78","unresolved":false,"context_lines":[{"line_number":44,"context_line":""},{"line_number":45,"context_line":"[1] http://specs.openstack.org/openstack/api-wg/guidelines/errors.html"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"Implements blueprint placement-api-error-handling"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"Change-Id: I9a833aa35d474caa35e640bbad6c436a3b16ac5e"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"df7087c5_22b0d4dd","line":47,"range":{"start_line":47,"start_character":21,"end_line":47,"end_character":49},"in_reply_to":"df7087c5_3fed4f8b","updated":"2018-03-16 23:15:08.000000000","message":"I wasn\u0027t the original author of the spec, and apparently, no blueprint was ever made. So I\u0027ll make one.","commit_id":"cabb3dedc32465e7ba84c4267c6bb6bff8f49c20"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"d4697ca0c4cddddc530aeff73120b53a9fc096ae","unresolved":false,"context_lines":[{"line_number":11,"context_line":"from one another. This change provides a simplest-thing-that-could-"},{"line_number":12,"context_line":"possibly-work solution to make that go."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"This solution comes about after a few different constraints and attempts:"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"* We would prefer to go on using the existing webob.exc exceptions, not"},{"line_number":17,"context_line":"  make subclasses."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":12,"id":"bf659307_099ab2b7","line":14,"range":{"start_line":14,"start_character":72,"end_line":14,"end_character":73},"updated":"2018-04-03 19:51:23.000000000","message":"whoopsie","commit_id":"7db0527daea616e009df0f762e26e9f26e587f55"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"d4697ca0c4cddddc530aeff73120b53a9fc096ae","unresolved":false,"context_lines":[{"line_number":31,"context_line":"that environ is set in json_error_formatter, we can set \u0027code\u0027 in the"},{"line_number":32,"context_line":"output."},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"This is done in a new microversion, 1.22. Every response gets a default"},{"line_number":35,"context_line":"code \u0027placement.undefined_code\u0027 from 1.22 on. Future development will"},{"line_number":36,"context_line":"add specific codes where required. This change adds a stub code for"},{"line_number":37,"context_line":"inventory in use when doing a PUT to .../inventories but the name"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":12,"id":"bf659307_c98fda72","line":34,"range":{"start_line":34,"start_character":36,"end_line":34,"end_character":40},"updated":"2018-04-03 19:51:23.000000000","message":"oh crap, we\u0027re racing for microversion numbers!!","commit_id":"7db0527daea616e009df0f762e26e9f26e587f55"}],"doc/source/contributor/placement.rst":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"f3bd622d1ebb72b708c16d684aeff274bf5c31ee","unresolved":false,"context_lines":[{"line_number":252,"context_line":"          changes in a patch that is separate from and prior to the HTTP API"},{"line_number":253,"context_line":"          change."},{"line_number":254,"context_line":""},{"line_number":255,"context_line":"If a handler needs to return an error response, with the advent of `link to"},{"line_number":256,"context_line":"spec once it merges`_, it is possible to include a code in the JSON error"},{"line_number":257,"context_line":"response.  This can be used to distinguish different errors with the same HTTP"},{"line_number":258,"context_line":"response status code (a common case is a generation conflict versus an"},{"line_number":259,"context_line":"inventory in use conflict). Error codes are simple namespaced strings (e.g.,"}],"source_content_type":"text/x-rst","patch_set":9,"id":"df7087c5_a7bf09cf","line":256,"range":{"start_line":255,"start_character":68,"end_line":256,"end_character":19},"updated":"2018-03-18 13:47:26.000000000","message":"Where\u0027s the proposed spec?","commit_id":"260fb78893b6c0863ecb1d0da7a6aa90ce123ae7"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"34732cd61aebb756e997af3cd465985e51be318f","unresolved":false,"context_lines":[{"line_number":252,"context_line":"          changes in a patch that is separate from and prior to the HTTP API"},{"line_number":253,"context_line":"          change."},{"line_number":254,"context_line":""},{"line_number":255,"context_line":"If a handler needs to return an error response, with the advent of `link to"},{"line_number":256,"context_line":"spec once it merges`_, it is possible to include a code in the JSON error"},{"line_number":257,"context_line":"response.  This can be used to distinguish different errors with the same HTTP"},{"line_number":258,"context_line":"response status code (a common case is a generation conflict versus an"},{"line_number":259,"context_line":"inventory in use conflict). Error codes are simple namespaced strings (e.g.,"}],"source_content_type":"text/x-rst","patch_set":9,"id":"df7087c5_9a0c8e3c","line":256,"range":{"start_line":255,"start_character":68,"end_line":256,"end_character":19},"in_reply_to":"df7087c5_47b06dde","updated":"2018-03-19 12:48:43.000000000","message":"Ah, I *knew* I had read it!  And that\u0027s why I couldn\u0027t find it - it wasn\u0027t under your name.\n\nWould you mind setting that URL on the blueprint [1] just to close the loop?\n\n[1] https://blueprints.launchpad.net/nova/+spec/placement-api-error-handling","commit_id":"260fb78893b6c0863ecb1d0da7a6aa90ce123ae7"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"9edb417708b7b9074a648c71dac7c1bcef41ae1b","unresolved":false,"context_lines":[{"line_number":252,"context_line":"          changes in a patch that is separate from and prior to the HTTP API"},{"line_number":253,"context_line":"          change."},{"line_number":254,"context_line":""},{"line_number":255,"context_line":"If a handler needs to return an error response, with the advent of `link to"},{"line_number":256,"context_line":"spec once it merges`_, it is possible to include a code in the JSON error"},{"line_number":257,"context_line":"response.  This can be used to distinguish different errors with the same HTTP"},{"line_number":258,"context_line":"response status code (a common case is a generation conflict versus an"},{"line_number":259,"context_line":"inventory in use conflict). Error codes are simple namespaced strings (e.g.,"}],"source_content_type":"text/x-rst","patch_set":9,"id":"df7087c5_47b06dde","line":256,"range":{"start_line":255,"start_character":68,"end_line":256,"end_character":19},"in_reply_to":"df7087c5_a7bf09cf","updated":"2018-03-18 14:01:52.000000000","message":"https://review.openstack.org/#/c/418393/","commit_id":"260fb78893b6c0863ecb1d0da7a6aa90ce123ae7"}],"nova/api/openstack/placement/errors.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"f3bd622d1ebb72b708c16d684aeff274bf5c31ee","unresolved":false,"context_lines":[{"line_number":15,"context_line":"# If it turns out we want to automate this, or put different resources in"},{"line_number":16,"context_line":"# different files, or otherwise change things, that\u0027s fine. The only thing"},{"line_number":17,"context_line":"# that needs to be maintained as the same are the strings that API end"},{"line_number":18,"context_line":"# users use. How they are created is completely fungible."},{"line_number":19,"context_line":""},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"# Do not change the string values. Once set, they are set."}],"source_content_type":"text/x-python","patch_set":9,"id":"df7087c5_27cbf972","line":18,"range":{"start_line":18,"start_character":48,"end_line":18,"end_character":56},"updated":"2018-03-18 13:47:26.000000000","message":"++","commit_id":"260fb78893b6c0863ecb1d0da7a6aa90ce123ae7"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"f3bd622d1ebb72b708c16d684aeff274bf5c31ee","unresolved":false,"context_lines":[{"line_number":18,"context_line":"# users use. How they are created is completely fungible."},{"line_number":19,"context_line":""},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"# Do not change the string values. Once set, they are set."},{"line_number":22,"context_line":"DEFAULT \u003d \u0027placement.undefined_code\u0027"},{"line_number":23,"context_line":"INVENTORY_INUSE \u003d \u0027placement.inventory.inuse\u0027"}],"source_content_type":"text/x-python","patch_set":9,"id":"df7087c5_077cb51e","line":21,"updated":"2018-03-18 13:47:26.000000000","message":"Do they need to be unique?  The purpose is served as long as, for a given *URI*, no two code paths produce the same error code.  So I\u0027m gonna say they don\u0027t need to be unique in that sense.  Though separate code paths using the same code could(/should?) use the same const rather than having a separate one with the same value.","commit_id":"260fb78893b6c0863ecb1d0da7a6aa90ce123ae7"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"9edb417708b7b9074a648c71dac7c1bcef41ae1b","unresolved":false,"context_lines":[{"line_number":18,"context_line":"# users use. How they are created is completely fungible."},{"line_number":19,"context_line":""},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"# Do not change the string values. Once set, they are set."},{"line_number":22,"context_line":"DEFAULT \u003d \u0027placement.undefined_code\u0027"},{"line_number":23,"context_line":"INVENTORY_INUSE \u003d \u0027placement.inventory.inuse\u0027"}],"source_content_type":"text/x-python","patch_set":9,"id":"df7087c5_07ca754e","line":21,"in_reply_to":"df7087c5_077cb51e","updated":"2018-03-18 14:01:52.000000000","message":"The intention, upstream in the errors guideline (linked in comitt message) and the discussion associated with it, is that the code is unique to the condition being described, so with _just_ the error code they can search various places on that code and get some useful information. \n\nWhich is in agreement with what you\u0027re saying.\n\nplacement.inventory.inuse is something that could come up in a variety of different requests (including updating inventory, deleting inventory) but it means the same thing. Placement. Inventory. In Use.","commit_id":"260fb78893b6c0863ecb1d0da7a6aa90ce123ae7"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"34732cd61aebb756e997af3cd465985e51be318f","unresolved":false,"context_lines":[{"line_number":18,"context_line":"# users use. How they are created is completely fungible."},{"line_number":19,"context_line":""},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"# Do not change the string values. Once set, they are set."},{"line_number":22,"context_line":"DEFAULT \u003d \u0027placement.undefined_code\u0027"},{"line_number":23,"context_line":"INVENTORY_INUSE \u003d \u0027placement.inventory.inuse\u0027"}],"source_content_type":"text/x-python","patch_set":9,"id":"df7087c5_3a68e2b8","line":21,"in_reply_to":"df7087c5_07ca754e","updated":"2018-03-19 12:48:43.000000000","message":"\u003e the code is\n \u003e unique to the condition being described, so with _just_ the error\n \u003e code they can search various places on that code and get some\n \u003e useful information.\n \u003e \n \u003e Which is in agreement with what you\u0027re saying.\n\nSorry to harp, but I\u0027m not sure it is.  As you say:\n\n \u003e placement.inventory.inuse is something that could come up in a\n \u003e variety of different requests (including updating inventory,\n \u003e deleting inventory)\n\nSo with _just_ the error code (i.e. not taking into account which API I called) I would find the code for update, delete, etc.  Unless it was placement.inventory.update.inuse/placement.inventory.delete.inuse.  Which, again, I don\u0027t think we need.\n\nTo be explicit about MHO:\n- \u0027placement.inventory.inuse\u0027 is good as is.\n- It is okay to use the same value in different code paths iff those code paths occur under different APIs.\n- Values should *not* be repeated in this file.  We could (eventually) hack that with something like [1].  That would force you to be sure that, if you\u0027re reusing a value, you really meant to do it, and are following The Rules.\n\nBut I was also hinting with my original note was that The Rules, whatever we decide they should be, ought to be described in this code comment (or the module docstring).\n\n[1] https://pastebin.com/raw/w2E4C9ZK","commit_id":"260fb78893b6c0863ecb1d0da7a6aa90ce123ae7"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"f3510dde678972cbd0044ddd19744bdda0936c0f","unresolved":false,"context_lines":[{"line_number":18,"context_line":"# users use. How they are created is completely fungible."},{"line_number":19,"context_line":""},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"# Do not change the string values. Once set, they are set."},{"line_number":22,"context_line":"DEFAULT \u003d \u0027placement.undefined_code\u0027"},{"line_number":23,"context_line":"INVENTORY_INUSE \u003d \u0027placement.inventory.inuse\u0027"}],"source_content_type":"text/x-python","patch_set":9,"id":"df7087c5_427a7188","line":21,"in_reply_to":"df7087c5_3a68e2b8","updated":"2018-03-20 09:22:16.000000000","message":"\u003e \u003e the code is\n \u003e \u003e unique to the condition being described, so with _just_ the error\n \u003e \u003e code they can search various places on that code and get some\n \u003e \u003e useful information.\n \u003e \u003e\n \u003e \u003e Which is in agreement with what you\u0027re saying.\n \u003e \n \u003e Sorry to harp, but I\u0027m not sure it is.  As you say:\n\nI think perhaps I should have said \"does not conflict with what you are saying\"\n\n \u003e So with _just_ the error code (i.e. not taking into account which\n \u003e API I called) I would find the code for update, delete, etc. \n\nThe error code is not for finding implementation code. It is for finding google results of people who experienced the same problem.\n\n \u003e - It is okay to use the same value in different code paths iff\n \u003e those code paths occur under different APIs.\n\nAPIs is not the term you want here. I think you mean unique HTTP method + URI pair. In this context API is the service.\n\n \u003e - Values should *not* be repeated in this file.  We could\n \u003e (eventually) hack that with something like [1].  That would force\n \u003e you to be sure that, if you\u0027re reusing a value, you really meant to\n \u003e do it, and are following The Rules.\n\nHuh, it hadn\u0027t even occurred to me that anyone would ever consider repeating values in this file. Are you being complete and explicit by including this item, or was there some specific concern that inspired this?\n\n \u003e But I was also hinting with my original note was that The Rules,\n \u003e whatever we decide they should be, ought to be described in this\n \u003e code comment (or the module docstring).\n\nI\u0027ll endeavor to make it more clearererer","commit_id":"260fb78893b6c0863ecb1d0da7a6aa90ce123ae7"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"b85da00e5ae2df83071e6b4c9b43a0d0ad7f31d2","unresolved":false,"context_lines":[{"line_number":18,"context_line":"# users use. How they are created is completely fungible."},{"line_number":19,"context_line":""},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"# Do not change the string values. Once set, they are set."},{"line_number":22,"context_line":"DEFAULT \u003d \u0027placement.undefined_code\u0027"},{"line_number":23,"context_line":"INVENTORY_INUSE \u003d \u0027placement.inventory.inuse\u0027"}],"source_content_type":"text/x-python","patch_set":9,"id":"df7087c5_b5306009","line":21,"in_reply_to":"df7087c5_427a7188","updated":"2018-03-20 15:49:55.000000000","message":"\u003e APIs is not the term you want here. I think you mean unique HTTP\n \u003e method + URI pair. In this context API is the service.\n\nI understand that. I\u0027m using \"API\" as shorthand because I\u0027m definitely not going to type \"unique HTTP method + URI pair\" every time.\n\n \u003e Huh, it hadn\u0027t even occurred to me that anyone would ever consider\n \u003e repeating values in this file. Are you being complete and explicit\n \u003e by including this item, or was there some specific concern that\n \u003e inspired this?\n\nJust gazing into the crystal ball.  It may not have occurred to you, but I guarantee it\u0027ll occur to *someone*.  So better to be explicit (and maybe even enforce).","commit_id":"260fb78893b6c0863ecb1d0da7a6aa90ce123ae7"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"f3bd622d1ebb72b708c16d684aeff274bf5c31ee","unresolved":false,"context_lines":[{"line_number":20,"context_line":""},{"line_number":21,"context_line":"# Do not change the string values. Once set, they are set."},{"line_number":22,"context_line":"DEFAULT \u003d \u0027placement.undefined_code\u0027"},{"line_number":23,"context_line":"INVENTORY_INUSE \u003d \u0027placement.inventory.inuse\u0027"}],"source_content_type":"text/x-python","patch_set":9,"id":"df7087c5_e7998179","line":23,"range":{"start_line":23,"start_character":19,"end_line":23,"end_character":44},"updated":"2018-03-18 13:47:26.000000000","message":"This is good for me.  I know further bikeshedding is inevitable, but we really don\u0027t need these to be crazy precise as long as they\u0027re unique* and meaningful.\n\n*within constraints described above","commit_id":"260fb78893b6c0863ecb1d0da7a6aa90ce123ae7"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"b85da00e5ae2df83071e6b4c9b43a0d0ad7f31d2","unresolved":false,"context_lines":[{"line_number":9,"context_line":"#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the"},{"line_number":10,"context_line":"#    License for the specific language governing permissions and limitations"},{"line_number":11,"context_line":"#    under the License."},{"line_number":12,"context_line":"\"\"\"Error code symbols to be used in structured JSON error responses."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"These are strings to be used in the \u0027code\u0027 attribute, as described by"},{"line_number":15,"context_line":"the API guideline on `errors`_."}],"source_content_type":"text/x-python","patch_set":11,"id":"df7087c5_f506d820","line":12,"updated":"2018-03-20 15:49:55.000000000","message":"\u003csniff\u003e It\u0027s... beautiful.","commit_id":"bfb2c6f7b1469c53029b56638a2466200b638b17"}],"nova/api/openstack/placement/handlers/inventory.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"667c6787f3c7dfc25f1e9d7f76071e02ebe6f033","unresolved":false,"context_lines":[{"line_number":324,"context_line":"        raise webob.exc.HTTPConflict("},{"line_number":325,"context_line":"            _(\u0027update conflict: %(error)s\u0027) % {\u0027error\u0027: exc},"},{"line_number":326,"context_line":"            # FIXME(cdent): This is a made up name that should be fixed after"},{"line_number":327,"context_line":"            # some discussion."},{"line_number":328,"context_line":"            comment\u003d\u0027placement.inventories.set.conflict\u0027)"},{"line_number":329,"context_line":"    except exception.InvalidInventoryCapacity as exc:"},{"line_number":330,"context_line":"        raise webob.exc.HTTPBadRequest("}],"source_content_type":"text/x-python","patch_set":7,"id":"df7087c5_5f936301","line":327,"updated":"2018-03-16 22:32:48.000000000","message":"To be clear: should be fixed before this is merged, cause we don\u0027t want to change codes again once they\u0027re changed from the generic \"unspecified\" one.\n\nBrainstormy comments on the error code itself:\n\n- Not sure we need \u0027placement\u0027, since that\u0027s known because the whole API is placement.\n- Not sure we need \u0027conflict\u0027, since that\u0027s already what 409 means.\n- But if we do keep \u0027conflict\u0027, suggest putting it in front of the \u0027inventories.set\u0027 part.  In general, I like the idea of doing a biggest-to-smallest-namespace kind of thing, à la java class nomenclature.\n- \u0027inventories.set\u0027 doesn\u0027t really help clarify here, because that\u0027s the API we called.\n- ...so what we want IMO is something that indicates InventoryInUse.  Perhaps the error code could be - and I\u0027m going out on a limb here - \u0027InventoryInUse\u0027.\n- In fact, one wonders if it may be appropriate in general for the error code to match the exception we\u0027re converting.  Or at least have that as a prefix - so if we manage to find two code paths in the same API that convert the same exception, we can disambiguate.\n- But not all error paths necessarily come from converting an exception, so perhaps the ones that do could be prefixed with \u0027exception.\u0027.\n\nAlso in general, I think it would be a good idea for all the error codes to live in a common place, with const-y names or whatever.  Might as well start that now.\n\nWe could even conceive of a test or hacking rule to enforce that (except for \u0027unspecified\u0027) we\u0027re only allowed to use each one once (per API?).  Cause that\u0027s sorta the whole point of this exercise.","commit_id":"cabb3dedc32465e7ba84c4267c6bb6bff8f49c20"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"18b9447e6fde1ffe9bc986c754c71c16f30d3956","unresolved":false,"context_lines":[{"line_number":324,"context_line":"        raise webob.exc.HTTPConflict("},{"line_number":325,"context_line":"            _(\u0027update conflict: %(error)s\u0027) % {\u0027error\u0027: exc},"},{"line_number":326,"context_line":"            # FIXME(cdent): This is a made up name that should be fixed after"},{"line_number":327,"context_line":"            # some discussion."},{"line_number":328,"context_line":"            comment\u003d\u0027placement.inventories.set.conflict\u0027)"},{"line_number":329,"context_line":"    except exception.InvalidInventoryCapacity as exc:"},{"line_number":330,"context_line":"        raise webob.exc.HTTPBadRequest("}],"source_content_type":"text/x-python","patch_set":7,"id":"df7087c5_a80043ad","line":327,"in_reply_to":"df7087c5_42d4e8bd","updated":"2018-03-17 01:39:40.000000000","message":"placement.inventories.inuse I can dig.  At least want the \"in use\" part represented.","commit_id":"cabb3dedc32465e7ba84c4267c6bb6bff8f49c20"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"2cbb21967766b7183e33286ffa77708d9c1f6a78","unresolved":false,"context_lines":[{"line_number":324,"context_line":"        raise webob.exc.HTTPConflict("},{"line_number":325,"context_line":"            _(\u0027update conflict: %(error)s\u0027) % {\u0027error\u0027: exc},"},{"line_number":326,"context_line":"            # FIXME(cdent): This is a made up name that should be fixed after"},{"line_number":327,"context_line":"            # some discussion."},{"line_number":328,"context_line":"            comment\u003d\u0027placement.inventories.set.conflict\u0027)"},{"line_number":329,"context_line":"    except exception.InvalidInventoryCapacity as exc:"},{"line_number":330,"context_line":"        raise webob.exc.HTTPBadRequest("}],"source_content_type":"text/x-python","patch_set":7,"id":"df7087c5_42d4e8bd","line":327,"in_reply_to":"df7087c5_5f936301","updated":"2018-03-16 23:15:08.000000000","message":"Yeah, I was trying to leave it out as bait, but so far you\u0027re the only nibble.\n\nThe use of the placement namespace comes out of discussions in api-sig (and elsewhere) about having global error code-strings, based on service type. This is so people could create what amount to error libraries. On Monday I\u0027ll try to find some references to that stuff.\n\nOnce you\u0027ve got that prefix, it immediately implies a sort of hierarchy:\n\n$service.$resource.$operation.$error\n\nAll of which is something that ought to be right there in the URL and request method (as you point out), which is why I\u0027ve been lukewarm about error codes, except for this damn conflict conflict.\n\nAgree that the errors would be nice to have constants. Ambivalent on the may as well start that now. I\u0027d really like us to be more happy with iteration and incrementalism.\n\nDirectly tying things to the exceptions might be interesting, but I like the degree of explicitness and scrutability that we\u0027ve got going on here. Making the associations is an invitation to magic at a distance and such things are why the nova API is so inscrutable. Placement\u0027s handlers are trying hard to be straightforward and simple, even if that comes at the cost of having to write a few more lines of code.\n\nplacement.inventories.inuse or variants thereof might be at least better.","commit_id":"cabb3dedc32465e7ba84c4267c6bb6bff8f49c20"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"4550ef12048b97846c20dc214fa749f30b25b9f9","unresolved":false,"context_lines":[{"line_number":324,"context_line":"        raise webob.exc.HTTPConflict("},{"line_number":325,"context_line":"            _(\u0027update conflict: %(error)s\u0027) % {\u0027error\u0027: exc},"},{"line_number":326,"context_line":"            # FIXME(cdent): This is a made up name that should be fixed after"},{"line_number":327,"context_line":"            # some discussion."},{"line_number":328,"context_line":"            comment\u003d\u0027placement.inventories.set.conflict\u0027)"},{"line_number":329,"context_line":"    except exception.InvalidInventoryCapacity as exc:"},{"line_number":330,"context_line":"        raise webob.exc.HTTPBadRequest("}],"source_content_type":"text/x-python","patch_set":7,"id":"df7087c5_8260bb37","line":327,"in_reply_to":"df7087c5_a80043ad","updated":"2018-03-17 10:41:06.000000000","message":"Some of the discussion on namespacing surrounded the errors guideline, linked in the commit message. That also makes a reference to the library concept. While looking at that I also found a bug: https://bugs.launchpad.net/openstack-api-wg/+bug/1756464","commit_id":"cabb3dedc32465e7ba84c4267c6bb6bff8f49c20"}]}
