)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"95b2b828ee9be2ad1b409400111ef5568996e50f","unresolved":false,"context_lines":[{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Return codes:"},{"line_number":13,"context_line":"204 NoContent on success"},{"line_number":14,"context_line":"404 NotFound if the entire resource provider does not exist"},{"line_number":15,"context_line":"405 MethodNotAllowed if microversion does not match"},{"line_number":16,"context_line":"409 Conflict if inventory in use or race condition"},{"line_number":17,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":11,"id":"9a30ddce_8c89f977","line":14,"range":{"start_line":14,"start_character":20,"end_line":14,"end_character":26},"updated":"2017-03-09 18:04:31.000000000","message":"nit: this word isn\u0027t needed.","commit_id":"f99a8db94dc216cbca24617557f4da7758d564a8"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"95b2b828ee9be2ad1b409400111ef5568996e50f","unresolved":false,"context_lines":[{"line_number":12,"context_line":"Return codes:"},{"line_number":13,"context_line":"204 NoContent on success"},{"line_number":14,"context_line":"404 NotFound if the entire resource provider does not exist"},{"line_number":15,"context_line":"405 MethodNotAllowed if microversion does not match"},{"line_number":16,"context_line":"409 Conflict if inventory in use or race condition"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"Change-Id: I1ecb12c888f873e8330367c8411d5a2ef0458495"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":11,"id":"9a30ddce_acc87da9","line":15,"range":{"start_line":15,"start_character":21,"end_line":15,"end_character":51},"updated":"2017-03-09 18:04:31.000000000","message":"\"if a microversion is specified that is before this change (1.5)\"","commit_id":"f99a8db94dc216cbca24617557f4da7758d564a8"}],"nova/api/openstack/placement/handler.py":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"ce8bffd39dfbe251d5d5b4cf63b683746501e40c","unresolved":false,"context_lines":[{"line_number":81,"context_line":"        \u0027GET\u0027: inventory.get_inventories,"},{"line_number":82,"context_line":"        \u0027POST\u0027: inventory.create_inventory,"},{"line_number":83,"context_line":"        \u0027PUT\u0027: inventory.set_inventories,"},{"line_number":84,"context_line":"        \u0027DELETE\u0027: inventory.delete_inventories"},{"line_number":85,"context_line":"    },"},{"line_number":86,"context_line":"    \u0027/resource_providers/{uuid}/inventories/{resource_class}\u0027: {"},{"line_number":87,"context_line":"        \u0027GET\u0027: inventory.get_inventory,"}],"source_content_type":"text/x-python","patch_set":15,"id":"3a1ff146_80d04055","line":84,"updated":"2017-03-15 13:37:42.000000000","message":"quick tip: if you end the newly-added line with a comma, then future patches that add another method to the request routing will produce diffs with only a single line of code changed.","commit_id":"03d8f61778acd048c0beaef1a254292226d3d071"}],"nova/api/openstack/placement/handlers/inventory.py":[{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"16702d57833d1cd98f94c9744f178a0af9773e43","unresolved":false,"context_lines":[{"line_number":395,"context_line":"    \"\"\"DELETE all inventory for a resource provider."},{"line_number":396,"context_line":""},{"line_number":397,"context_line":"    Delete inventory as required to reset all the inventory."},{"line_number":398,"context_line":"    If an inventory to be deleted is in use, return a 409."},{"line_number":399,"context_line":"    On success return a 204 No content."},{"line_number":400,"context_line":"    \"\"\""},{"line_number":401,"context_line":"    context \u003d req.environ[\u0027placement.context\u0027]"},{"line_number":402,"context_line":"    uuid \u003d util.wsgi_path_item(req.environ, \u0027uuid\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba5201f7_478457d3","line":399,"range":{"start_line":398,"start_character":45,"end_line":399,"end_character":38},"updated":"2017-01-04 17:56:03.000000000","message":"Micro-nit: if you say \u0027204 No Content\u0027, you shoudl say \u0027409 Conflict\u0027.","commit_id":"c5fc7a020c233d591116d2575e4e6062cda8c0d6"},{"author":{"_account_id":8175,"name":"Rafael Folco","email":"rfolco@redhat.com","username":"rfolco"},"change_message_id":"f6ac4d61661071b947b15bff5fcda444ba22da6e","unresolved":false,"context_lines":[{"line_number":395,"context_line":"    \"\"\"DELETE all inventory for a resource provider."},{"line_number":396,"context_line":""},{"line_number":397,"context_line":"    Delete inventory as required to reset all the inventory."},{"line_number":398,"context_line":"    If an inventory to be deleted is in use, return a 409."},{"line_number":399,"context_line":"    On success return a 204 No content."},{"line_number":400,"context_line":"    \"\"\""},{"line_number":401,"context_line":"    context \u003d req.environ[\u0027placement.context\u0027]"},{"line_number":402,"context_line":"    uuid \u003d util.wsgi_path_item(req.environ, \u0027uuid\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba5201f7_66a95a90","line":399,"range":{"start_line":398,"start_character":45,"end_line":399,"end_character":38},"in_reply_to":"ba5201f7_478457d3","updated":"2017-01-04 18:50:21.000000000","message":"consistency, agreed.","commit_id":"c5fc7a020c233d591116d2575e4e6062cda8c0d6"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"16702d57833d1cd98f94c9744f178a0af9773e43","unresolved":false,"context_lines":[{"line_number":403,"context_line":"    resource_provider \u003d objects.ResourceProvider.get_by_uuid("},{"line_number":404,"context_line":"        context, uuid)"},{"line_number":405,"context_line":""},{"line_number":406,"context_line":"    inv_list \u003d []"},{"line_number":407,"context_line":"    inventories \u003d objects.InventoryList(objects\u003dinv_list)"},{"line_number":408,"context_line":""},{"line_number":409,"context_line":"    try:"},{"line_number":410,"context_line":"        resource_provider.set_inventory(inventories)"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba5201f7_47e9b77f","line":407,"range":{"start_line":406,"start_character":4,"end_line":407,"end_character":57},"updated":"2017-01-04 17:56:03.000000000","message":"You don\u0027t need the two lines. Just write:\n\n    inventories \u003d objects.InventoryList(objects\u003d[])","commit_id":"c5fc7a020c233d591116d2575e4e6062cda8c0d6"},{"author":{"_account_id":8175,"name":"Rafael Folco","email":"rfolco@redhat.com","username":"rfolco"},"change_message_id":"f6ac4d61661071b947b15bff5fcda444ba22da6e","unresolved":false,"context_lines":[{"line_number":403,"context_line":"    resource_provider \u003d objects.ResourceProvider.get_by_uuid("},{"line_number":404,"context_line":"        context, uuid)"},{"line_number":405,"context_line":""},{"line_number":406,"context_line":"    inv_list \u003d []"},{"line_number":407,"context_line":"    inventories \u003d objects.InventoryList(objects\u003dinv_list)"},{"line_number":408,"context_line":""},{"line_number":409,"context_line":"    try:"},{"line_number":410,"context_line":"        resource_provider.set_inventory(inventories)"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba5201f7_a697c246","line":407,"range":{"start_line":406,"start_character":4,"end_line":407,"end_character":57},"in_reply_to":"ba5201f7_47e9b77f","updated":"2017-01-04 18:50:21.000000000","message":"ack","commit_id":"c5fc7a020c233d591116d2575e4e6062cda8c0d6"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"16702d57833d1cd98f94c9744f178a0af9773e43","unresolved":false,"context_lines":[{"line_number":411,"context_line":""},{"line_number":412,"context_line":"    except exception.InventoryWithResourceClassNotFound as exc:"},{"line_number":413,"context_line":"        raise webob.exc.HTTPConflict("},{"line_number":414,"context_line":"            _(\u0027Race condition detected when setting inventory. No inventory \u0027"},{"line_number":415,"context_line":"              \u0027record with resource class for resource provider \u0027"},{"line_number":416,"context_line":"              \u0027%(rp_uuid)s: %(error)s\u0027) % {\u0027rp_uuid\u0027: resource_provider.uuid,"},{"line_number":417,"context_line":"                                           \u0027error\u0027: exc},"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba5201f7_224e6196","line":414,"range":{"start_line":414,"start_character":15,"end_line":414,"end_character":61},"updated":"2017-01-04 17:56:03.000000000","message":"I don\u0027t think that this is necessarily true - there could be other situations that raise this error that are not race-related.","commit_id":"c5fc7a020c233d591116d2575e4e6062cda8c0d6"},{"author":{"_account_id":8175,"name":"Rafael Folco","email":"rfolco@redhat.com","username":"rfolco"},"change_message_id":"f6ac4d61661071b947b15bff5fcda444ba22da6e","unresolved":false,"context_lines":[{"line_number":411,"context_line":""},{"line_number":412,"context_line":"    except exception.InventoryWithResourceClassNotFound as exc:"},{"line_number":413,"context_line":"        raise webob.exc.HTTPConflict("},{"line_number":414,"context_line":"            _(\u0027Race condition detected when setting inventory. No inventory \u0027"},{"line_number":415,"context_line":"              \u0027record with resource class for resource provider \u0027"},{"line_number":416,"context_line":"              \u0027%(rp_uuid)s: %(error)s\u0027) % {\u0027rp_uuid\u0027: resource_provider.uuid,"},{"line_number":417,"context_line":"                                           \u0027error\u0027: exc},"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba5201f7_e6c2aa33","line":414,"range":{"start_line":414,"start_character":15,"end_line":414,"end_character":61},"in_reply_to":"ba5201f7_224e6196","updated":"2017-01-04 18:50:21.000000000","message":"This is mistakenly there. This exception would never be raised, since it does not update the inventory, it deletes it.","commit_id":"c5fc7a020c233d591116d2575e4e6062cda8c0d6"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"b3b5e134c5798f6b42707d6f75b02e80a2a0e127","unresolved":false,"context_lines":[{"line_number":404,"context_line":"        context, uuid)"},{"line_number":405,"context_line":""},{"line_number":406,"context_line":"    inv_list \u003d []"},{"line_number":407,"context_line":"    inventories \u003d objects.InventoryList(objects\u003dinv_list)"},{"line_number":408,"context_line":""},{"line_number":409,"context_line":"    try:"},{"line_number":410,"context_line":"        resource_provider.set_inventory(inventories)"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba5201f7_c2a035a2","line":407,"updated":"2017-01-04 17:54:12.000000000","message":"I\u0027m not sure it is worth assigning inv_list, may as well just pass [] as the value of the objects param.","commit_id":"a57105c316a62b25769b1b8e0b001c85292b82e3"},{"author":{"_account_id":8175,"name":"Rafael Folco","email":"rfolco@redhat.com","username":"rfolco"},"change_message_id":"9764efbad1cb524bfeee0973164c196c3a34e041","unresolved":false,"context_lines":[{"line_number":404,"context_line":"        context, uuid)"},{"line_number":405,"context_line":""},{"line_number":406,"context_line":"    inv_list \u003d []"},{"line_number":407,"context_line":"    inventories \u003d objects.InventoryList(objects\u003dinv_list)"},{"line_number":408,"context_line":""},{"line_number":409,"context_line":"    try:"},{"line_number":410,"context_line":"        resource_provider.set_inventory(inventories)"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba5201f7_466536b3","line":407,"in_reply_to":"ba5201f7_c2a035a2","updated":"2017-01-04 18:42:57.000000000","message":"true!","commit_id":"a57105c316a62b25769b1b8e0b001c85292b82e3"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"b3b5e134c5798f6b42707d6f75b02e80a2a0e127","unresolved":false,"context_lines":[{"line_number":409,"context_line":"    try:"},{"line_number":410,"context_line":"        resource_provider.set_inventory(inventories)"},{"line_number":411,"context_line":""},{"line_number":412,"context_line":"    except exception.InventoryWithResourceClassNotFound as exc:"},{"line_number":413,"context_line":"        raise webob.exc.HTTPConflict("},{"line_number":414,"context_line":"            _(\u0027Race condition detected when setting inventory. No inventory \u0027"},{"line_number":415,"context_line":"              \u0027record with resource class for resource provider \u0027"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba5201f7_8240eda6","line":412,"updated":"2017-01-04 17:54:12.000000000","message":"I think if we\u0027re calling set_inventory with an empty inventory list, _update_inventory_for_provider will not be called, just  _delete_inventory_from_provider. Given that, this exception will not be raised by the set_inventory call.","commit_id":"a57105c316a62b25769b1b8e0b001c85292b82e3"},{"author":{"_account_id":8175,"name":"Rafael Folco","email":"rfolco@redhat.com","username":"rfolco"},"change_message_id":"9764efbad1cb524bfeee0973164c196c3a34e041","unresolved":false,"context_lines":[{"line_number":409,"context_line":"    try:"},{"line_number":410,"context_line":"        resource_provider.set_inventory(inventories)"},{"line_number":411,"context_line":""},{"line_number":412,"context_line":"    except exception.InventoryWithResourceClassNotFound as exc:"},{"line_number":413,"context_line":"        raise webob.exc.HTTPConflict("},{"line_number":414,"context_line":"            _(\u0027Race condition detected when setting inventory. No inventory \u0027"},{"line_number":415,"context_line":"              \u0027record with resource class for resource provider \u0027"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba5201f7_865b9ef5","line":412,"in_reply_to":"ba5201f7_8240eda6","updated":"2017-01-04 18:42:57.000000000","message":"true^2","commit_id":"a57105c316a62b25769b1b8e0b001c85292b82e3"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"95b2b828ee9be2ad1b409400111ef5568996e50f","unresolved":false,"context_lines":[{"line_number":399,"context_line":"    On success return a 204 No content."},{"line_number":400,"context_line":"    Return 405 if the wanted microversion does not match."},{"line_number":401,"context_line":"    \"\"\""},{"line_number":402,"context_line":"    microversion.raise_http_resp_if_not_version(req, 405, (1, 4))"},{"line_number":403,"context_line":"    context \u003d req.environ[\u0027placement.context\u0027]"},{"line_number":404,"context_line":"    uuid \u003d util.wsgi_path_item(req.environ, \u0027uuid\u0027)"},{"line_number":405,"context_line":"    resource_provider \u003d objects.ResourceProvider.get_by_uuid("}],"source_content_type":"text/x-python","patch_set":11,"id":"9a30ddce_6cbcc5dc","line":402,"range":{"start_line":402,"start_character":59,"end_line":402,"end_character":63},"updated":"2017-03-09 18:04:31.000000000","message":"Should be 1, 5","commit_id":"f99a8db94dc216cbca24617557f4da7758d564a8"},{"author":{"_account_id":8175,"name":"Rafael Folco","email":"rfolco@redhat.com","username":"rfolco"},"change_message_id":"9a669f085734adf638fb155fb657b8c2a8b38f53","unresolved":false,"context_lines":[{"line_number":399,"context_line":"    On success return a 204 No content."},{"line_number":400,"context_line":"    Return 405 if the wanted microversion does not match."},{"line_number":401,"context_line":"    \"\"\""},{"line_number":402,"context_line":"    microversion.raise_http_resp_if_not_version(req, 405, (1, 4))"},{"line_number":403,"context_line":"    context \u003d req.environ[\u0027placement.context\u0027]"},{"line_number":404,"context_line":"    uuid \u003d util.wsgi_path_item(req.environ, \u0027uuid\u0027)"},{"line_number":405,"context_line":"    resource_provider \u003d objects.ResourceProvider.get_by_uuid("}],"source_content_type":"text/x-python","patch_set":11,"id":"9a30ddce_8c32d95d","line":402,"range":{"start_line":402,"start_character":59,"end_line":402,"end_character":63},"in_reply_to":"9a30ddce_6cbcc5dc","updated":"2017-03-09 18:11:48.000000000","message":"oops!","commit_id":"f99a8db94dc216cbca24617557f4da7758d564a8"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"432d42a2d6e678709e0546f45ab218f2e92fd041","unresolved":false,"context_lines":[{"line_number":389,"context_line":"    return _send_inventories(req.response, resource_provider, inventories)"},{"line_number":390,"context_line":""},{"line_number":391,"context_line":""},{"line_number":392,"context_line":"@webob.dec.wsgify"},{"line_number":393,"context_line":"@util.require_content(\u0027application/json\u0027)"},{"line_number":394,"context_line":"def update_inventory(req):"},{"line_number":395,"context_line":"    \"\"\"PUT to update one inventory."}],"source_content_type":"text/x-python","patch_set":14,"id":"9a30ddce_cc52a812","side":"PARENT","line":392,"updated":"2017-03-13 16:09:18.000000000","message":"Since https://review.openstack.org/#/c/395194/ has merged, may as well use the new decorator. Then you don\u0027t need the json_formatter arg below.","commit_id":"7dfcb537e185c4ccc80adc93a2b75f051f2194f3"},{"author":{"_account_id":8175,"name":"Rafael Folco","email":"rfolco@redhat.com","username":"rfolco"},"change_message_id":"48486bffe292c753f216723f0055bf7fc4196005","unresolved":false,"context_lines":[{"line_number":389,"context_line":"    return _send_inventories(req.response, resource_provider, inventories)"},{"line_number":390,"context_line":""},{"line_number":391,"context_line":""},{"line_number":392,"context_line":"@webob.dec.wsgify"},{"line_number":393,"context_line":"@util.require_content(\u0027application/json\u0027)"},{"line_number":394,"context_line":"def update_inventory(req):"},{"line_number":395,"context_line":"    \"\"\"PUT to update one inventory."}],"source_content_type":"text/x-python","patch_set":14,"id":"3a1ff146_7446a924","side":"PARENT","line":392,"in_reply_to":"9a30ddce_cc52a812","updated":"2017-03-15 13:26:05.000000000","message":"ack","commit_id":"7dfcb537e185c4ccc80adc93a2b75f051f2194f3"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"432d42a2d6e678709e0546f45ab218f2e92fd041","unresolved":false,"context_lines":[{"line_number":413,"context_line":"            exception.InventoryInUse) as exc:"},{"line_number":414,"context_line":"        raise webob.exc.HTTPConflict("},{"line_number":415,"context_line":"            _(\u0027update conflict: %(error)s\u0027) % {\u0027error\u0027: exc},"},{"line_number":416,"context_line":"            json_formatter\u003dutil.json_error_formatter)"},{"line_number":417,"context_line":""},{"line_number":418,"context_line":"    response \u003d req.response"},{"line_number":419,"context_line":"    response.status \u003d 204"}],"source_content_type":"text/x-python","patch_set":14,"id":"9a30ddce_8c451044","line":416,"updated":"2017-03-13 16:09:18.000000000","message":"With the new decorator this will not be needed.","commit_id":"76f024f81780855bf36f493abc9286238ddbb440"},{"author":{"_account_id":8175,"name":"Rafael Folco","email":"rfolco@redhat.com","username":"rfolco"},"change_message_id":"48486bffe292c753f216723f0055bf7fc4196005","unresolved":false,"context_lines":[{"line_number":413,"context_line":"            exception.InventoryInUse) as exc:"},{"line_number":414,"context_line":"        raise webob.exc.HTTPConflict("},{"line_number":415,"context_line":"            _(\u0027update conflict: %(error)s\u0027) % {\u0027error\u0027: exc},"},{"line_number":416,"context_line":"            json_formatter\u003dutil.json_error_formatter)"},{"line_number":417,"context_line":""},{"line_number":418,"context_line":"    response \u003d req.response"},{"line_number":419,"context_line":"    response.status \u003d 204"}],"source_content_type":"text/x-python","patch_set":14,"id":"3a1ff146_346351b3","line":416,"in_reply_to":"9a30ddce_8c451044","updated":"2017-03-15 13:26:05.000000000","message":"done","commit_id":"76f024f81780855bf36f493abc9286238ddbb440"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"ad020cba941ec41e79f27b4b5f69ef59e0b5b89e","unresolved":false,"context_lines":[{"line_number":389,"context_line":"    return _send_inventories(req.response, resource_provider, inventories)"},{"line_number":390,"context_line":""},{"line_number":391,"context_line":""},{"line_number":392,"context_line":"@webob.dec.wsgify"},{"line_number":393,"context_line":"@util.require_content(\u0027application/json\u0027)"},{"line_number":394,"context_line":"def update_inventory(req):"},{"line_number":395,"context_line":"    \"\"\"PUT to update one inventory."}],"source_content_type":"text/x-python","patch_set":16,"id":"3a1ff146_b4a57a05","side":"PARENT","line":392,"updated":"2017-03-15 14:49:38.000000000","message":"You removed the json_formatter below, but have not updated the decorator here, you want to either: \n\n`@wsgi_wrapper.PlacementWsgify` here\n\nor put the json_formatter back on the exception below.","commit_id":"1a8453fd9bfe49276da7d9ca72462347f04001cb"},{"author":{"_account_id":8175,"name":"Rafael Folco","email":"rfolco@redhat.com","username":"rfolco"},"change_message_id":"e3ef19383a6c39ff24de6d355373bcf4fbbfe5a1","unresolved":false,"context_lines":[{"line_number":389,"context_line":"    return _send_inventories(req.response, resource_provider, inventories)"},{"line_number":390,"context_line":""},{"line_number":391,"context_line":""},{"line_number":392,"context_line":"@webob.dec.wsgify"},{"line_number":393,"context_line":"@util.require_content(\u0027application/json\u0027)"},{"line_number":394,"context_line":"def update_inventory(req):"},{"line_number":395,"context_line":"    \"\"\"PUT to update one inventory."}],"source_content_type":"text/x-python","patch_set":16,"id":"3a1ff146_8163dfb0","side":"PARENT","line":392,"in_reply_to":"3a1ff146_b4a57a05","updated":"2017-03-15 15:31:17.000000000","message":"ack","commit_id":"1a8453fd9bfe49276da7d9ca72462347f04001cb"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"1aa11e51e451c45426a80f1228e782fa2dec4081","unresolved":false,"context_lines":[{"line_number":392,"context_line":""},{"line_number":393,"context_line":""},{"line_number":394,"context_line":"@webob.dec.wsgify"},{"line_number":395,"context_line":"@wsgi_wrapper.PlacementWsgify"},{"line_number":396,"context_line":"def delete_inventories(req):"},{"line_number":397,"context_line":"    \"\"\"DELETE all inventory for a resource provider."},{"line_number":398,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"3a1ff146_345fa342","line":395,"updated":"2017-03-16 11:26:02.000000000","message":"You only want one of these decorators. PlacementWsgify replaces webob.dec.wsgify.","commit_id":"e24aa59b5d7d2b4f9dda314ec6b0361c8011d15f"},{"author":{"_account_id":8175,"name":"Rafael Folco","email":"rfolco@redhat.com","username":"rfolco"},"change_message_id":"f3a9602b2f1711a3ba963587d0cef40aacae7efa","unresolved":false,"context_lines":[{"line_number":392,"context_line":""},{"line_number":393,"context_line":""},{"line_number":394,"context_line":"@webob.dec.wsgify"},{"line_number":395,"context_line":"@wsgi_wrapper.PlacementWsgify"},{"line_number":396,"context_line":"def delete_inventories(req):"},{"line_number":397,"context_line":"    \"\"\"DELETE all inventory for a resource provider."},{"line_number":398,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"3a1ff146_59ee13ed","line":395,"in_reply_to":"3a1ff146_345fa342","updated":"2017-03-16 13:47:29.000000000","message":"ack","commit_id":"e24aa59b5d7d2b4f9dda314ec6b0361c8011d15f"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"1aa11e51e451c45426a80f1228e782fa2dec4081","unresolved":false,"context_lines":[{"line_number":412,"context_line":"    try:"},{"line_number":413,"context_line":"        resource_provider.set_inventory(inventories)"},{"line_number":414,"context_line":"    except (exception.ConcurrentUpdateDetected,"},{"line_number":415,"context_line":"            exception.InventoryInUse) as exc:"},{"line_number":416,"context_line":"        raise webob.exc.HTTPConflict("},{"line_number":417,"context_line":"            _(\u0027update conflict: %(error)s\u0027) % {\u0027error\u0027: exc})"},{"line_number":418,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"3a1ff146_94a69751","line":415,"updated":"2017-03-16 11:26:02.000000000","message":"You\u0027ve created a gabbi test for the InventoryInUse case, but not for the ConcurrentUpdateDetected case (unless I\u0027ve missed it?)","commit_id":"e24aa59b5d7d2b4f9dda314ec6b0361c8011d15f"},{"author":{"_account_id":8175,"name":"Rafael Folco","email":"rfolco@redhat.com","username":"rfolco"},"change_message_id":"f3a9602b2f1711a3ba963587d0cef40aacae7efa","unresolved":false,"context_lines":[{"line_number":412,"context_line":"    try:"},{"line_number":413,"context_line":"        resource_provider.set_inventory(inventories)"},{"line_number":414,"context_line":"    except (exception.ConcurrentUpdateDetected,"},{"line_number":415,"context_line":"            exception.InventoryInUse) as exc:"},{"line_number":416,"context_line":"        raise webob.exc.HTTPConflict("},{"line_number":417,"context_line":"            _(\u0027update conflict: %(error)s\u0027) % {\u0027error\u0027: exc})"},{"line_number":418,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"3a1ff146_f9cfbf7c","line":415,"in_reply_to":"3a1ff146_94a69751","updated":"2017-03-16 13:47:29.000000000","message":"yep, 409 bad generation","commit_id":"e24aa59b5d7d2b4f9dda314ec6b0361c8011d15f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4c4541f7aa7221a941f27463f1ae47c74ed89c45","unresolved":false,"context_lines":[{"line_number":401,"context_line":"    except (exception.ConcurrentUpdateDetected,"},{"line_number":402,"context_line":"            exception.InventoryInUse) as exc:"},{"line_number":403,"context_line":"        raise webob.exc.HTTPConflict("},{"line_number":404,"context_line":"            _(\u0027update conflict: %(error)s\u0027) % {\u0027error\u0027: exc})"},{"line_number":405,"context_line":""},{"line_number":406,"context_line":"    response \u003d req.response"},{"line_number":407,"context_line":"    response.status \u003d 204"}],"source_content_type":"text/x-python","patch_set":19,"id":"1a1ced50_aa55d450","line":404,"range":{"start_line":404,"start_character":12,"end_line":404,"end_character":61},"updated":"2017-03-21 01:28:23.000000000","message":"Given https://review.openstack.org/#/c/436773/ we should probably not dump the error from the DB API into the REST API output, but actually use a specific error message here.","commit_id":"f903a6c56bf473fdc87de05544a460681d025e4f"},{"author":{"_account_id":8175,"name":"Rafael Folco","email":"rfolco@redhat.com","username":"rfolco"},"change_message_id":"e6ab4994c87702bf9e9c6d7e97b941bbc57ab873","unresolved":false,"context_lines":[{"line_number":401,"context_line":"    except (exception.ConcurrentUpdateDetected,"},{"line_number":402,"context_line":"            exception.InventoryInUse) as exc:"},{"line_number":403,"context_line":"        raise webob.exc.HTTPConflict("},{"line_number":404,"context_line":"            _(\u0027update conflict: %(error)s\u0027) % {\u0027error\u0027: exc})"},{"line_number":405,"context_line":""},{"line_number":406,"context_line":"    response \u003d req.response"},{"line_number":407,"context_line":"    response.status \u003d 204"}],"source_content_type":"text/x-python","patch_set":19,"id":"1a1ced50_013319f7","line":404,"range":{"start_line":404,"start_character":12,"end_line":404,"end_character":61},"in_reply_to":"1a1ced50_aa55d450","updated":"2017-03-21 12:32:41.000000000","message":"ack we\u0027ll address this in a separate change asap.","commit_id":"f903a6c56bf473fdc87de05544a460681d025e4f"}],"nova/api/openstack/placement/microversion.py":[{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"95b2b828ee9be2ad1b409400111ef5568996e50f","unresolved":false,"context_lines":[{"line_number":77,"context_line":"def raise_http_resp_if_not_version(req, resp, min_version, max_version\u003dNone):"},{"line_number":78,"context_line":"    \"\"\"Utility to raise an HTTP response status code if the wanted"},{"line_number":79,"context_line":"    microversion does not match."},{"line_number":80,"context_line":"    404 NotFound: New entirely resource"},{"line_number":81,"context_line":"    405 MethodNotAllowed: New method for existing resource"},{"line_number":82,"context_line":"    \"\"\""},{"line_number":83,"context_line":"    HTTP_RC \u003d {404: webob.exc.HTTPNotFound,"}],"source_content_type":"text/x-python","patch_set":11,"id":"9a30ddce_4cc4615e","line":80,"range":{"start_line":80,"start_character":18,"end_line":80,"end_character":39},"updated":"2017-03-09 18:04:31.000000000","message":"English nit: \"Entirely new resource\"","commit_id":"f99a8db94dc216cbca24617557f4da7758d564a8"},{"author":{"_account_id":8175,"name":"Rafael Folco","email":"rfolco@redhat.com","username":"rfolco"},"change_message_id":"9a669f085734adf638fb155fb657b8c2a8b38f53","unresolved":false,"context_lines":[{"line_number":77,"context_line":"def raise_http_resp_if_not_version(req, resp, min_version, max_version\u003dNone):"},{"line_number":78,"context_line":"    \"\"\"Utility to raise an HTTP response status code if the wanted"},{"line_number":79,"context_line":"    microversion does not match."},{"line_number":80,"context_line":"    404 NotFound: New entirely resource"},{"line_number":81,"context_line":"    405 MethodNotAllowed: New method for existing resource"},{"line_number":82,"context_line":"    \"\"\""},{"line_number":83,"context_line":"    HTTP_RC \u003d {404: webob.exc.HTTPNotFound,"}],"source_content_type":"text/x-python","patch_set":11,"id":"9a30ddce_4c4541b1","line":80,"range":{"start_line":80,"start_character":18,"end_line":80,"end_character":39},"in_reply_to":"9a30ddce_4cc4615e","updated":"2017-03-09 18:11:48.000000000","message":"nuts!","commit_id":"f99a8db94dc216cbca24617557f4da7758d564a8"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"af4d1d4bb0c30a4c25d94851dda778d37dd1d996","unresolved":false,"context_lines":[{"line_number":74,"context_line":"            version_string, exc))"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"def raise_http_resp_if_not_version(req, resp, min_version, max_version\u003dNone):"},{"line_number":78,"context_line":"    \"\"\"Utility to raise an HTTP response status code if the wanted"},{"line_number":79,"context_line":"    microversion does not match."},{"line_number":80,"context_line":"    404 NotFound: Entirely new resource"}],"source_content_type":"text/x-python","patch_set":12,"id":"9a30ddce_deb1cf48","line":77,"updated":"2017-03-09 20:03:09.000000000","message":"Changing this to take different status code\u0027s is a great idea but a ideas:\n\n* s/resp/status_code/ \u0027resp\u0027 is easy to confuse with a Response object\n* consider doing this change in a patch before adding the DELETE on inventories change?\n* the stuff below","commit_id":"a26e02222341f756647f447a4011b8ffcf2058ca"},{"author":{"_account_id":8175,"name":"Rafael Folco","email":"rfolco@redhat.com","username":"rfolco"},"change_message_id":"10bfffb5bc1be8fabc6e4d1df70f84a842533dfd","unresolved":false,"context_lines":[{"line_number":74,"context_line":"            version_string, exc))"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"def raise_http_resp_if_not_version(req, resp, min_version, max_version\u003dNone):"},{"line_number":78,"context_line":"    \"\"\"Utility to raise an HTTP response status code if the wanted"},{"line_number":79,"context_line":"    microversion does not match."},{"line_number":80,"context_line":"    404 NotFound: Entirely new resource"}],"source_content_type":"text/x-python","patch_set":12,"id":"9a30ddce_3812da09","line":77,"in_reply_to":"9a30ddce_deb1cf48","updated":"2017-03-10 15:19:30.000000000","message":"good ideas.","commit_id":"a26e02222341f756647f447a4011b8ffcf2058ca"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"af4d1d4bb0c30a4c25d94851dda778d37dd1d996","unresolved":false,"context_lines":[{"line_number":80,"context_line":"    404 NotFound: Entirely new resource"},{"line_number":81,"context_line":"    405 MethodNotAllowed: New method for existing resource"},{"line_number":82,"context_line":"    \"\"\""},{"line_number":83,"context_line":"    HTTP_RC \u003d {404: webob.exc.HTTPNotFound,"},{"line_number":84,"context_line":"               405: webob.exc.HTTPMethodNotAllowed"},{"line_number":85,"context_line":"              }"},{"line_number":86,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"9a30ddce_c3a2dc4a","line":83,"updated":"2017-03-09 20:03:09.000000000","message":"webob.exc.status_map exists and replicates this information, so it should be possible to use it, getting rid of this data structure and...","commit_id":"a26e02222341f756647f447a4011b8ffcf2058ca"},{"author":{"_account_id":8175,"name":"Rafael Folco","email":"rfolco@redhat.com","username":"rfolco"},"change_message_id":"10bfffb5bc1be8fabc6e4d1df70f84a842533dfd","unresolved":false,"context_lines":[{"line_number":80,"context_line":"    404 NotFound: Entirely new resource"},{"line_number":81,"context_line":"    405 MethodNotAllowed: New method for existing resource"},{"line_number":82,"context_line":"    \"\"\""},{"line_number":83,"context_line":"    HTTP_RC \u003d {404: webob.exc.HTTPNotFound,"},{"line_number":84,"context_line":"               405: webob.exc.HTTPMethodNotAllowed"},{"line_number":85,"context_line":"              }"},{"line_number":86,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"9a30ddce_781ff207","line":83,"in_reply_to":"9a30ddce_c3a2dc4a","updated":"2017-03-10 15:19:30.000000000","message":"concern below...","commit_id":"a26e02222341f756647f447a4011b8ffcf2058ca"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"18e742a157d5e75f95e8e60d1a023a14cb758183","unresolved":false,"context_lines":[{"line_number":82,"context_line":"    \"\"\""},{"line_number":83,"context_line":"    HTTP_RC \u003d {404: webob.exc.HTTPNotFound,"},{"line_number":84,"context_line":"               405: webob.exc.HTTPMethodNotAllowed"},{"line_number":85,"context_line":"              }"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    want_version \u003d req.environ[MICROVERSION_ENVIRON]"},{"line_number":88,"context_line":"    if not want_version.matches(min_version, max_version):"}],"source_content_type":"text/x-python","patch_set":12,"id":"9a30ddce_f297ac45","line":85,"updated":"2017-03-09 18:43:10.000000000","message":"couple things. recommend naming the variable http_exc instead of HTTP_RC. We typically use all caps for module-level constants and lowercased names for local variables.\n\nSecondly, please add an assertion checking that the resp parameter is actually in the dict\u0027s keys and raise a RuntimeError early if not. Something like:\n\n http_exc \u003d {\n     404: webob.exc.HTTPNotFound,\n     405: webob.exc.HTTPMethodNotAllowed,\n }\n if resp not in http_exec:\n     raise RuntimeError(\"Unmapped response code: %s\" % resp)","commit_id":"a26e02222341f756647f447a4011b8ffcf2058ca"},{"author":{"_account_id":8175,"name":"Rafael Folco","email":"rfolco@redhat.com","username":"rfolco"},"change_message_id":"10bfffb5bc1be8fabc6e4d1df70f84a842533dfd","unresolved":false,"context_lines":[{"line_number":82,"context_line":"    \"\"\""},{"line_number":83,"context_line":"    HTTP_RC \u003d {404: webob.exc.HTTPNotFound,"},{"line_number":84,"context_line":"               405: webob.exc.HTTPMethodNotAllowed"},{"line_number":85,"context_line":"              }"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    want_version \u003d req.environ[MICROVERSION_ENVIRON]"},{"line_number":88,"context_line":"    if not want_version.matches(min_version, max_version):"}],"source_content_type":"text/x-python","patch_set":12,"id":"9a30ddce_f8c04252","line":85,"in_reply_to":"9a30ddce_8338e4f0","updated":"2017-03-10 15:19:30.000000000","message":"\u003e\u003e\u003e raise webob.exc.status_map[000]\nTraceback (most recent call last):\n  File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\nKeyError: 0\n\nLooking for an alternative way of handling KeyError and using webob.exc.status_map...","commit_id":"a26e02222341f756647f447a4011b8ffcf2058ca"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"af4d1d4bb0c30a4c25d94851dda778d37dd1d996","unresolved":false,"context_lines":[{"line_number":82,"context_line":"    \"\"\""},{"line_number":83,"context_line":"    HTTP_RC \u003d {404: webob.exc.HTTPNotFound,"},{"line_number":84,"context_line":"               405: webob.exc.HTTPMethodNotAllowed"},{"line_number":85,"context_line":"              }"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    want_version \u003d req.environ[MICROVERSION_ENVIRON]"},{"line_number":88,"context_line":"    if not want_version.matches(min_version, max_version):"}],"source_content_type":"text/x-python","patch_set":12,"id":"9a30ddce_8338e4f0","line":85,"in_reply_to":"9a30ddce_f297ac45","updated":"2017-03-09 20:03:09.000000000","message":"Why this instead of letting an untrapped KeyError  on http_exc or status_map raise?\n\n    want_version \u003d req.environ[MICROVERSION_ENVIRON]\n    if not want_version.match(min_version, max_version):\n        raise exc.status_map(resp)\n\nIs enough, isn\u0027t it?","commit_id":"a26e02222341f756647f447a4011b8ffcf2058ca"},{"author":{"_account_id":8175,"name":"Rafael Folco","email":"rfolco@redhat.com","username":"rfolco"},"change_message_id":"10bfffb5bc1be8fabc6e4d1df70f84a842533dfd","unresolved":false,"context_lines":[{"line_number":82,"context_line":"    \"\"\""},{"line_number":83,"context_line":"    HTTP_RC \u003d {404: webob.exc.HTTPNotFound,"},{"line_number":84,"context_line":"               405: webob.exc.HTTPMethodNotAllowed"},{"line_number":85,"context_line":"              }"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    want_version \u003d req.environ[MICROVERSION_ENVIRON]"},{"line_number":88,"context_line":"    if not want_version.matches(min_version, max_version):"}],"source_content_type":"text/x-python","patch_set":12,"id":"9a30ddce_98c66666","line":85,"in_reply_to":"9a30ddce_f297ac45","updated":"2017-03-10 15:19:30.000000000","message":"You\u0027re right. While I like status_map idea, KeyError still needs to be handled there.","commit_id":"a26e02222341f756647f447a4011b8ffcf2058ca"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"18e742a157d5e75f95e8e60d1a023a14cb758183","unresolved":false,"context_lines":[{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    want_version \u003d req.environ[MICROVERSION_ENVIRON]"},{"line_number":88,"context_line":"    if not want_version.matches(min_version, max_version):"},{"line_number":89,"context_line":"        raise HTTP_RC.get(resp)"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"class MicroversionMiddleware(object):"}],"source_content_type":"text/x-python","patch_set":12,"id":"9a30ddce_326b0487","line":89,"updated":"2017-03-09 18:43:10.000000000","message":"use:\n\n raise http_exc[resp]","commit_id":"a26e02222341f756647f447a4011b8ffcf2058ca"},{"author":{"_account_id":8175,"name":"Rafael Folco","email":"rfolco@redhat.com","username":"rfolco"},"change_message_id":"10bfffb5bc1be8fabc6e4d1df70f84a842533dfd","unresolved":false,"context_lines":[{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    want_version \u003d req.environ[MICROVERSION_ENVIRON]"},{"line_number":88,"context_line":"    if not want_version.matches(min_version, max_version):"},{"line_number":89,"context_line":"        raise HTTP_RC.get(resp)"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"class MicroversionMiddleware(object):"}],"source_content_type":"text/x-python","patch_set":12,"id":"9a30ddce_18a99690","line":89,"in_reply_to":"9a30ddce_326b0487","updated":"2017-03-10 15:19:30.000000000","message":"status_map vs keyerror dilema...","commit_id":"a26e02222341f756647f447a4011b8ffcf2058ca"}],"nova/tests/functional/api/openstack/placement/gabbits/inventory.yaml":[{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"16702d57833d1cd98f94c9744f178a0af9773e43","unresolved":false,"context_lines":[{"line_number":492,"context_line":"      openstack-api-version: placement 1.3"},{"line_number":493,"context_line":"  status: 204"},{"line_number":494,"context_line":""},{"line_number":495,"context_line":"- name: get wiped inventories"},{"line_number":496,"context_line":"  GET: /resource_providers/$ENVIRON[\u0027RP_UUID\u0027]/inventories"},{"line_number":497,"context_line":"  status: 200"},{"line_number":498,"context_line":"  response_headers:"}],"source_content_type":"text/x-yaml","patch_set":1,"id":"ba5201f7_402d1e94","line":495,"range":{"start_line":495,"start_character":8,"end_line":495,"end_character":29},"updated":"2017-01-04 17:56:03.000000000","message":"better: get inventories after deletion","commit_id":"c5fc7a020c233d591116d2575e4e6062cda8c0d6"},{"author":{"_account_id":8175,"name":"Rafael Folco","email":"rfolco@redhat.com","username":"rfolco"},"change_message_id":"38294ac427095293878ee7df9f7df9f887b4200b","unresolved":false,"context_lines":[{"line_number":492,"context_line":"      openstack-api-version: placement 1.3"},{"line_number":493,"context_line":"  status: 204"},{"line_number":494,"context_line":""},{"line_number":495,"context_line":"- name: get wiped inventories"},{"line_number":496,"context_line":"  GET: /resource_providers/$ENVIRON[\u0027RP_UUID\u0027]/inventories"},{"line_number":497,"context_line":"  status: 200"},{"line_number":498,"context_line":"  response_headers:"}],"source_content_type":"text/x-yaml","patch_set":1,"id":"ba5201f7_06f88e48","line":495,"range":{"start_line":495,"start_character":8,"end_line":495,"end_character":29},"in_reply_to":"ba5201f7_402d1e94","updated":"2017-01-04 18:58:36.000000000","message":"agreed!","commit_id":"c5fc7a020c233d591116d2575e4e6062cda8c0d6"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"16702d57833d1cd98f94c9744f178a0af9773e43","unresolved":false,"context_lines":[{"line_number":496,"context_line":"  GET: /resource_providers/$ENVIRON[\u0027RP_UUID\u0027]/inventories"},{"line_number":497,"context_line":"  status: 200"},{"line_number":498,"context_line":"  response_headers:"},{"line_number":499,"context_line":"      content-type: /application/json/"},{"line_number":500,"context_line":""},{"line_number":501,"context_line":"- name: delete all inventory again"},{"line_number":502,"context_line":"  DELETE: /resource_providers/$ENVIRON[\u0027RP_UUID\u0027]/inventories"}],"source_content_type":"text/x-yaml","patch_set":1,"id":"ba5201f7_800c663c","line":499,"updated":"2017-01-04 17:56:03.000000000","message":"There should be a test here to verify that the inventory amounts are zero after the deletion.","commit_id":"c5fc7a020c233d591116d2575e4e6062cda8c0d6"},{"author":{"_account_id":8175,"name":"Rafael Folco","email":"rfolco@redhat.com","username":"rfolco"},"change_message_id":"38294ac427095293878ee7df9f7df9f887b4200b","unresolved":false,"context_lines":[{"line_number":496,"context_line":"  GET: /resource_providers/$ENVIRON[\u0027RP_UUID\u0027]/inventories"},{"line_number":497,"context_line":"  status: 200"},{"line_number":498,"context_line":"  response_headers:"},{"line_number":499,"context_line":"      content-type: /application/json/"},{"line_number":500,"context_line":""},{"line_number":501,"context_line":"- name: delete all inventory again"},{"line_number":502,"context_line":"  DELETE: /resource_providers/$ENVIRON[\u0027RP_UUID\u0027]/inventories"}],"source_content_type":"text/x-yaml","patch_set":1,"id":"ba5201f7_466a96ef","line":499,"in_reply_to":"ba5201f7_800c663c","updated":"2017-01-04 18:58:36.000000000","message":"done.       $.inventories: {}","commit_id":"c5fc7a020c233d591116d2575e4e6062cda8c0d6"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"16702d57833d1cd98f94c9744f178a0af9773e43","unresolved":false,"context_lines":[{"line_number":498,"context_line":"  response_headers:"},{"line_number":499,"context_line":"      content-type: /application/json/"},{"line_number":500,"context_line":""},{"line_number":501,"context_line":"- name: delete all inventory again"},{"line_number":502,"context_line":"  DELETE: /resource_providers/$ENVIRON[\u0027RP_UUID\u0027]/inventories"},{"line_number":503,"context_line":"  request_headers:"},{"line_number":504,"context_line":"      openstack-api-version: placement 1.3"}],"source_content_type":"text/x-yaml","patch_set":1,"id":"ba5201f7_e03292f1","line":501,"range":{"start_line":501,"start_character":8,"end_line":501,"end_character":34},"updated":"2017-01-04 17:56:03.000000000","message":"What is the purpose of this test? To verify that you can call DELETE even when there isn\u0027t any inventory?","commit_id":"c5fc7a020c233d591116d2575e4e6062cda8c0d6"},{"author":{"_account_id":8175,"name":"Rafael Folco","email":"rfolco@redhat.com","username":"rfolco"},"change_message_id":"38294ac427095293878ee7df9f7df9f887b4200b","unresolved":false,"context_lines":[{"line_number":498,"context_line":"  response_headers:"},{"line_number":499,"context_line":"      content-type: /application/json/"},{"line_number":500,"context_line":""},{"line_number":501,"context_line":"- name: delete all inventory again"},{"line_number":502,"context_line":"  DELETE: /resource_providers/$ENVIRON[\u0027RP_UUID\u0027]/inventories"},{"line_number":503,"context_line":"  request_headers:"},{"line_number":504,"context_line":"      openstack-api-version: placement 1.3"}],"source_content_type":"text/x-yaml","patch_set":1,"id":"ba5201f7_2633d215","line":501,"range":{"start_line":501,"start_character":8,"end_line":501,"end_character":34},"in_reply_to":"ba5201f7_e03292f1","updated":"2017-01-04 18:58:36.000000000","message":"DELETE empty inventories still returns 204. It behaves differently from deleting a single inventory, which would return 404. I\u0027ll rename it to DELETE empty inventories","commit_id":"c5fc7a020c233d591116d2575e4e6062cda8c0d6"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"b3b5e134c5798f6b42707d6f75b02e80a2a0e127","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"ba5201f7_a25a514e","updated":"2017-01-04 17:54:12.000000000","message":"You should add a test in here that confirms that if you try to use the DELETE with an earlier microversion you get an error response. In this situation the ideal response would be a 405 response code, but the version_handler decorator will probably return a 404, which is okay for now (as it replicates what nova tends to do). That\u0027s a bug in the decorator which I\u0027ll investigate and fix elsewhere.","commit_id":"a57105c316a62b25769b1b8e0b001c85292b82e3"},{"author":{"_account_id":8175,"name":"Rafael Folco","email":"rfolco@redhat.com","username":"rfolco"},"change_message_id":"9764efbad1cb524bfeee0973164c196c3a34e041","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"ba5201f7_06ffaeaa","in_reply_to":"ba5201f7_a25a514e","updated":"2017-01-04 18:42:57.000000000","message":"Thanks for the heads up. This info will save me hours of investigation :)","commit_id":"a57105c316a62b25769b1b8e0b001c85292b82e3"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"ad020cba941ec41e79f27b4b5f69ef59e0b5b89e","unresolved":false,"context_lines":[{"line_number":514,"context_line":"  DELETE: /resource_providers/$ENVIRON[\u0027RP_UUID\u0027]/inventories"},{"line_number":515,"context_line":"  request_headers:"},{"line_number":516,"context_line":"      openstack-api-version: placement 1.4"},{"line_number":517,"context_line":"  status: 405"}],"source_content_type":"text/x-yaml","patch_set":16,"id":"3a1ff146_546a8681","line":517,"updated":"2017-03-15 14:49:38.000000000","message":"There\u0027s no test (that I can find) for the 409 HTTPConflict case that could be raised in the delete_inventories method. When you create one, make sure you check the structure of the response body to confirm the formatting of the json (which happens either because of the PlacementWsgify decorator or json_formatter arg to the exception).","commit_id":"cd91982c1cfd9461336f184fd2c8e096a3b300fc"},{"author":{"_account_id":8175,"name":"Rafael Folco","email":"rfolco@redhat.com","username":"rfolco"},"change_message_id":"e3ef19383a6c39ff24de6d355373bcf4fbbfe5a1","unresolved":false,"context_lines":[{"line_number":514,"context_line":"  DELETE: /resource_providers/$ENVIRON[\u0027RP_UUID\u0027]/inventories"},{"line_number":515,"context_line":"  request_headers:"},{"line_number":516,"context_line":"      openstack-api-version: placement 1.4"},{"line_number":517,"context_line":"  status: 405"}],"source_content_type":"text/x-yaml","patch_set":16,"id":"3a1ff146_01936f5c","line":517,"in_reply_to":"3a1ff146_546a8681","updated":"2017-03-15 15:31:17.000000000","message":"Thanks for the PlacementWsgify decorator use case explanation. Question: Do you think we need a test for 404 and another one for nop (where microversion matches) ?","commit_id":"cd91982c1cfd9461336f184fd2c8e096a3b300fc"}],"nova/tests/functional/api/openstack/placement/gabbits/with-allocations.yaml":[{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"1aa11e51e451c45426a80f1228e782fa2dec4081","unresolved":false,"context_lines":[{"line_number":35,"context_line":"  DELETE: /resource_providers/$ENVIRON[\u0027RP_UUID\u0027]/inventories"},{"line_number":36,"context_line":"  request_headers:"},{"line_number":37,"context_line":"      openstack-api-version: placement 1.5"},{"line_number":38,"context_line":"  status: 409"}],"source_content_type":"text/x-yaml","patch_set":17,"id":"3a1ff146_948f77cb","line":38,"updated":"2017-03-16 11:26:02.000000000","message":"nit: you could make this test a bit more complete by including a response_strings entry a bit like the test above\n\nNot strictly necessary though. The bit that matters is the 409","commit_id":"e24aa59b5d7d2b4f9dda314ec6b0361c8011d15f"},{"author":{"_account_id":8175,"name":"Rafael Folco","email":"rfolco@redhat.com","username":"rfolco"},"change_message_id":"f3a9602b2f1711a3ba963587d0cef40aacae7efa","unresolved":false,"context_lines":[{"line_number":35,"context_line":"  DELETE: /resource_providers/$ENVIRON[\u0027RP_UUID\u0027]/inventories"},{"line_number":36,"context_line":"  request_headers:"},{"line_number":37,"context_line":"      openstack-api-version: placement 1.5"},{"line_number":38,"context_line":"  status: 409"}],"source_content_type":"text/x-yaml","patch_set":17,"id":"3a1ff146_99a5ebb6","line":38,"in_reply_to":"3a1ff146_948f77cb","updated":"2017-03-16 13:47:29.000000000","message":"ack","commit_id":"e24aa59b5d7d2b4f9dda314ec6b0361c8011d15f"}],"releasenotes/notes/delete-inventories-placement-api-13582910371308c4.yaml":[{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"432d42a2d6e678709e0546f45ab218f2e92fd041","unresolved":false,"context_lines":[{"line_number":11,"context_line":"    * 204 NoContent on success"},{"line_number":12,"context_line":"    * 404 NotFound for missing resource provider"},{"line_number":13,"context_line":"    * 405 MethodNotAllowed on earlier microversion"},{"line_number":14,"context_line":"    * 409 Conflict if inventory in use or race condition"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"    Requires OpenStack-API-Version placement 1.5"}],"source_content_type":"text/x-yaml","patch_set":14,"id":"9a30ddce_0c5a00f2","line":14,"updated":"2017-03-13 16:09:18.000000000","message":"\"or race condition\" is perhaps a bit too vague? Consdier either saying \"if some other request concurrently updates this resource provider\" (or something similar to that) or just leave it off.","commit_id":"76f024f81780855bf36f493abc9286238ddbb440"},{"author":{"_account_id":8175,"name":"Rafael Folco","email":"rfolco@redhat.com","username":"rfolco"},"change_message_id":"48486bffe292c753f216723f0055bf7fc4196005","unresolved":false,"context_lines":[{"line_number":11,"context_line":"    * 204 NoContent on success"},{"line_number":12,"context_line":"    * 404 NotFound for missing resource provider"},{"line_number":13,"context_line":"    * 405 MethodNotAllowed on earlier microversion"},{"line_number":14,"context_line":"    * 409 Conflict if inventory in use or race condition"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"    Requires OpenStack-API-Version placement 1.5"}],"source_content_type":"text/x-yaml","patch_set":14,"id":"3a1ff146_b492e155","line":14,"in_reply_to":"9a30ddce_0c5a00f2","updated":"2017-03-15 13:26:05.000000000","message":"ack","commit_id":"76f024f81780855bf36f493abc9286238ddbb440"}]}
