)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"0c497d2c2b1bb524d53aaaf09e8cd8223b06379b","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Placement: allow to set reserved value equal to total for inventory"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This is needed for ironic use case, when during cleaning, resources"},{"line_number":10,"context_line":"are reserved by ironic itself."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Closes-Bug: 1767381"},{"line_number":13,"context_line":"Change-Id: I037d9b8c1bb554c3437434cc9a57ddb630dd62f0"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"9f6a8fd7_ad511565","line":10,"updated":"2018-04-27 19:23:31.000000000","message":"Also mention the cyborg use case here.","commit_id":"b6011b4dd1dd8c90749fa819d5704daf9581fce1"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"70c73a0d5f313b6bfea37ede32bb056ed6ba0df7","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Placement: allow to set reserved value equal to total for inventory"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This is needed for ironic use case, when during cleaning, resources"},{"line_number":10,"context_line":"are reserved by ironic itself."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Closes-Bug: 1767381"},{"line_number":13,"context_line":"Change-Id: I037d9b8c1bb554c3437434cc9a57ddb630dd62f0"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"9f6a8fd7_08e9057f","line":10,"in_reply_to":"9f6a8fd7_ad511565","updated":"2018-04-28 19:18:46.000000000","message":"will write my assumption regarding what that use case is, might need someone more in context to check","commit_id":"b6011b4dd1dd8c90749fa819d5704daf9581fce1"}],"nova/api/openstack/placement/exception.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"1fd0f24e11cd45b6ac9048b3099bf681ba42188f","unresolved":false,"context_lines":[{"line_number":99,"context_line":"                \"The reserved value is greater than or equal to total.\")"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"class InvalidInventoryCapacityReservedCanBeTotal(InvalidInventoryCapacity):"},{"line_number":103,"context_line":"    msg_fmt \u003d _(\"Invalid inventory for \u0027%(resource_class)s\u0027 on \""},{"line_number":104,"context_line":"                \"resource provider \u0027%(resource_provider)s\u0027. \""},{"line_number":105,"context_line":"                \"The reserved value is greater than total.\")"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f7c97a3_1e9dfa08","line":102,"range":{"start_line":102,"start_character":38,"end_line":102,"end_character":41},"updated":"2018-05-16 14:32:02.000000000","message":"Cannot?","commit_id":"2fe4794d6a560ab115b8b2577fcf57bb3d185ba7"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"3848c4ab529ade15c84790abbf6ea4b6c4642702","unresolved":false,"context_lines":[{"line_number":99,"context_line":"                \"The reserved value is greater than or equal to total.\")"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"class InvalidInventoryCapacityReservedCanBeTotal(InvalidInventoryCapacity):"},{"line_number":103,"context_line":"    msg_fmt \u003d _(\"Invalid inventory for \u0027%(resource_class)s\u0027 on \""},{"line_number":104,"context_line":"                \"resource provider \u0027%(resource_provider)s\u0027. \""},{"line_number":105,"context_line":"                \"The reserved value is greater than total.\")"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f7c97a3_1e441a73","line":102,"range":{"start_line":102,"start_character":38,"end_line":102,"end_character":41},"in_reply_to":"5f7c97a3_1e9dfa08","updated":"2018-05-16 14:37:26.000000000","message":"can as i removed the equal part from the message :) not sure about a good name for this tho","commit_id":"2fe4794d6a560ab115b8b2577fcf57bb3d185ba7"}],"nova/api/openstack/placement/handlers/inventory.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"928a43bf3fcbc660ba84e3bdc3429332d64efa26","unresolved":false,"context_lines":[{"line_number":167,"context_line":"                                       resource_class,"},{"line_number":168,"context_line":"                                       **data)"},{"line_number":169,"context_line":"    can_set_reserved_equal_total \u003d (req.environ["},{"line_number":170,"context_line":"        microversion.MICROVERSION_ENVIRON].matches((1, 26), None))"},{"line_number":171,"context_line":""},{"line_number":172,"context_line":"    try:"},{"line_number":173,"context_line":"        resource_provider.add_inventory(inventory,"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f7c97a3_feaefe2b","line":170,"updated":"2018-05-16 14:34:54.000000000","message":"Hmm, why wouldn\u0027t we just fail right here if reserved\u003d\u003d total, instead of passing this boolean down? I\u0027d expect the things underneath us to just start allowing it, and depend on us rejecting the formerly-invalid case in the API. The data model doesn\u0027t need to support every possible previous iteration, the API does.","commit_id":"2fe4794d6a560ab115b8b2577fcf57bb3d185ba7"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9c38601c1a251b7e2090ccb46343434e9facbae3","unresolved":false,"context_lines":[{"line_number":167,"context_line":"                                       resource_class,"},{"line_number":168,"context_line":"                                       **data)"},{"line_number":169,"context_line":"    can_set_reserved_equal_total \u003d (req.environ["},{"line_number":170,"context_line":"        microversion.MICROVERSION_ENVIRON].matches((1, 26), None))"},{"line_number":171,"context_line":""},{"line_number":172,"context_line":"    try:"},{"line_number":173,"context_line":"        resource_provider.add_inventory(inventory,"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f7c97a3_7e366e05","line":170,"range":{"start_line":170,"start_character":60,"end_line":170,"end_character":64},"updated":"2018-05-16 14:39:34.000000000","message":"This is the max_version right? You don\u0027t need to specify it since it defaults to None:\n\nhttp://git.openstack.org/cgit/openstack/microversion-parse/tree/microversion_parse/__init__.py#n37\n\nAnd is kind of confusing to read while it\u0027s in here since it\u0027s all done on one line.","commit_id":"2fe4794d6a560ab115b8b2577fcf57bb3d185ba7"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"e7ed0ff57132fabb870a02188014c276ca826ccf","unresolved":false,"context_lines":[{"line_number":167,"context_line":"                                       resource_class,"},{"line_number":168,"context_line":"                                       **data)"},{"line_number":169,"context_line":"    can_set_reserved_equal_total \u003d (req.environ["},{"line_number":170,"context_line":"        microversion.MICROVERSION_ENVIRON].matches((1, 26), None))"},{"line_number":171,"context_line":""},{"line_number":172,"context_line":"    try:"},{"line_number":173,"context_line":"        resource_provider.add_inventory(inventory,"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f7c97a3_61780f8f","line":170,"in_reply_to":"5f7c97a3_1e12da62","updated":"2018-05-16 14:39:42.000000000","message":"Just looking further to be sure, since the capacity logic is:\n\n (total - reserved) * allocation_ratio\n\nI think that simply asserting that\n\n reserved \u003c total\n\nin the API should be fine.","commit_id":"2fe4794d6a560ab115b8b2577fcf57bb3d185ba7"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"3848c4ab529ade15c84790abbf6ea4b6c4642702","unresolved":false,"context_lines":[{"line_number":167,"context_line":"                                       resource_class,"},{"line_number":168,"context_line":"                                       **data)"},{"line_number":169,"context_line":"    can_set_reserved_equal_total \u003d (req.environ["},{"line_number":170,"context_line":"        microversion.MICROVERSION_ENVIRON].matches((1, 26), None))"},{"line_number":171,"context_line":""},{"line_number":172,"context_line":"    try:"},{"line_number":173,"context_line":"        resource_provider.add_inventory(inventory,"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f7c97a3_1e12da62","line":170,"in_reply_to":"5f7c97a3_feaefe2b","updated":"2018-05-16 14:37:26.000000000","message":"hrm, indeed, this way would be clearer","commit_id":"2fe4794d6a560ab115b8b2577fcf57bb3d185ba7"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"3bb972505b77511202840fc1c5fd4061911589e8","unresolved":false,"context_lines":[{"line_number":163,"context_line":"    else:"},{"line_number":164,"context_line":"        op \u003d operator.lt"},{"line_number":165,"context_line":"        exc_class \u003d exception.InvalidInventoryCapacityReservedCanBeTotal"},{"line_number":166,"context_line":"    if isinstance(inventories, rp_obj.Inventory):"},{"line_number":167,"context_line":"        inventories \u003d rp_obj.InventoryList(objects\u003d[inventories])"},{"line_number":168,"context_line":"    for inventory in inventories:"},{"line_number":169,"context_line":"        if op(inventory.capacity, 0):"}],"source_content_type":"text/x-python","patch_set":5,"id":"5f7c97a3_37a01942","line":166,"updated":"2018-05-16 16:14:47.000000000","message":"I\u0027m not a huge fan of this, being that this method takes type-ambiguous arguments, but it\u0027s not super critical.","commit_id":"64dbe985d203659e8d83f5a597559ea10bc862a9"}],"nova/api/openstack/placement/objects/resource_provider.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"0c497d2c2b1bb524d53aaaf09e8cd8223b06379b","unresolved":false,"context_lines":[{"line_number":204,"context_line":"    for rc_id in to_add:"},{"line_number":205,"context_line":"        rc_str \u003d _RC_CACHE.string_from_id(rc_id)"},{"line_number":206,"context_line":"        inv_record \u003d inv_list.find(rc_str)"},{"line_number":207,"context_line":"        if can_set_reserved_equal_total:"},{"line_number":208,"context_line":"            op \u003d operator.lt"},{"line_number":209,"context_line":"            exc_class \u003d exception.InvalidInventoryCapacityReservedCanBeTotal"},{"line_number":210,"context_line":"        else:"},{"line_number":211,"context_line":"            op \u003d operator.le"},{"line_number":212,"context_line":"            exc_class \u003d exception.InvalidInventoryCapacity"},{"line_number":213,"context_line":"        if op(inv_record.capacity, 0):"},{"line_number":214,"context_line":"            raise exc_class("},{"line_number":215,"context_line":"                resource_class\u003drc_str,"},{"line_number":216,"context_line":"                resource_provider\u003drp.uuid)"},{"line_number":217,"context_line":"        ins_stmt \u003d _INV_TBL.insert().values("},{"line_number":218,"context_line":"                resource_provider_id\u003drp.id,"},{"line_number":219,"context_line":"                resource_class_id\u003drc_id,"}],"source_content_type":"text/x-python","patch_set":1,"id":"9f6a8fd7_6dd69df4","line":216,"range":{"start_line":207,"start_character":0,"end_line":216,"end_character":42},"updated":"2018-04-27 19:23:31.000000000","message":"Maybe worth pulling this out into a _validate_inventory helper method.","commit_id":"b6011b4dd1dd8c90749fa819d5704daf9581fce1"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"70c73a0d5f313b6bfea37ede32bb056ed6ba0df7","unresolved":false,"context_lines":[{"line_number":204,"context_line":"    for rc_id in to_add:"},{"line_number":205,"context_line":"        rc_str \u003d _RC_CACHE.string_from_id(rc_id)"},{"line_number":206,"context_line":"        inv_record \u003d inv_list.find(rc_str)"},{"line_number":207,"context_line":"        if can_set_reserved_equal_total:"},{"line_number":208,"context_line":"            op \u003d operator.lt"},{"line_number":209,"context_line":"            exc_class \u003d exception.InvalidInventoryCapacityReservedCanBeTotal"},{"line_number":210,"context_line":"        else:"},{"line_number":211,"context_line":"            op \u003d operator.le"},{"line_number":212,"context_line":"            exc_class \u003d exception.InvalidInventoryCapacity"},{"line_number":213,"context_line":"        if op(inv_record.capacity, 0):"},{"line_number":214,"context_line":"            raise exc_class("},{"line_number":215,"context_line":"                resource_class\u003drc_str,"},{"line_number":216,"context_line":"                resource_provider\u003drp.uuid)"},{"line_number":217,"context_line":"        ins_stmt \u003d _INV_TBL.insert().values("},{"line_number":218,"context_line":"                resource_provider_id\u003drp.id,"},{"line_number":219,"context_line":"                resource_class_id\u003drc_id,"}],"source_content_type":"text/x-python","patch_set":1,"id":"9f6a8fd7_68f4415c","line":216,"range":{"start_line":207,"start_character":0,"end_line":216,"end_character":42},"in_reply_to":"9f6a8fd7_6dd69df4","updated":"2018-04-28 19:18:46.000000000","message":"Done","commit_id":"b6011b4dd1dd8c90749fa819d5704daf9581fce1"}],"nova/api/openstack/placement/rest_api_version_history.rst":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"0c497d2c2b1bb524d53aaaf09e8cd8223b06379b","unresolved":false,"context_lines":[{"line_number":284,"context_line":"1.24 Allow inventories to have reserved value equal to total"},{"line_number":285,"context_line":"------------------------------------------------------------"},{"line_number":286,"context_line":""},{"line_number":287,"context_line":"This is needed for ironic and cyborg use cases. Since this version, there will"},{"line_number":288,"context_line":"be no way to tell the API to fail if reserved equals to total."}],"source_content_type":"text/x-rst","patch_set":1,"id":"9f6a8fd7_2d18a5d1","line":288,"range":{"start_line":287,"start_character":0,"end_line":288,"end_character":62},"updated":"2018-04-27 19:23:31.000000000","message":"Nah, we don\u0027t need to mention today\u0027s use cases here.  Just explain the functionality.","commit_id":"b6011b4dd1dd8c90749fa819d5704daf9581fce1"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"70c73a0d5f313b6bfea37ede32bb056ed6ba0df7","unresolved":false,"context_lines":[{"line_number":284,"context_line":"1.24 Allow inventories to have reserved value equal to total"},{"line_number":285,"context_line":"------------------------------------------------------------"},{"line_number":286,"context_line":""},{"line_number":287,"context_line":"This is needed for ironic and cyborg use cases. Since this version, there will"},{"line_number":288,"context_line":"be no way to tell the API to fail if reserved equals to total."}],"source_content_type":"text/x-rst","patch_set":1,"id":"9f6a8fd7_48effd86","line":288,"range":{"start_line":287,"start_character":0,"end_line":288,"end_character":62},"in_reply_to":"9f6a8fd7_2d18a5d1","updated":"2018-04-28 19:18:46.000000000","message":"Tried to expand on L284 a bit :)","commit_id":"b6011b4dd1dd8c90749fa819d5704daf9581fce1"}],"nova/tests/functional/api/openstack/placement/db/test_resource_provider.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"0c497d2c2b1bb524d53aaaf09e8cd8223b06379b","unresolved":false,"context_lines":[{"line_number":932,"context_line":"                      % fields.ResourceClass.DISK_GB, str(error))"},{"line_number":933,"context_line":"        self.assertIn(\"on resource provider \u0027%s\u0027.\""},{"line_number":934,"context_line":"                      % rp.uuid, str(error))"},{"line_number":935,"context_line":"        self.assertIn(\"greater than or equal to total\", str(error))"},{"line_number":936,"context_line":""},{"line_number":937,"context_line":"    def test_add_invalid_inventory(self):"},{"line_number":938,"context_line":"        self._test_add_invalid_inventory()"}],"source_content_type":"text/x-python","patch_set":1,"id":"9f6a8fd7_4d2079f8","line":935,"range":{"start_line":935,"start_character":8,"end_line":935,"end_character":67},"updated":"2018-04-27 19:23:31.000000000","message":"Let\u0027s add one where we attempt to set the reserved *greater* than the total and validate that your new exception (\"greater than total\") is the one raised.","commit_id":"b6011b4dd1dd8c90749fa819d5704daf9581fce1"}],"nova/tests/functional/api/openstack/placement/gabbits/inventory.yaml":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"0c497d2c2b1bb524d53aaaf09e8cd8223b06379b","unresolved":false,"context_lines":[{"line_number":680,"context_line":"  status: 400"},{"line_number":681,"context_line":"  response_strings:"},{"line_number":682,"context_line":"      - Unable to update inventory"},{"line_number":683,"context_line":"      - greater than total"},{"line_number":684,"context_line":"  response_json_paths:"},{"line_number":685,"context_line":"      $.errors[0].title: Bad Request"},{"line_number":686,"context_line":""}],"source_content_type":"text/x-yaml","patch_set":1,"id":"9f6a8fd7_2d7d05e7","line":683,"range":{"start_line":683,"start_character":8,"end_line":683,"end_character":26},"updated":"2018-04-27 19:23:31.000000000","message":"Okay, like this one.  So feel free to disregard the previous comment.","commit_id":"b6011b4dd1dd8c90749fa819d5704daf9581fce1"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"70c73a0d5f313b6bfea37ede32bb056ed6ba0df7","unresolved":false,"context_lines":[{"line_number":680,"context_line":"  status: 400"},{"line_number":681,"context_line":"  response_strings:"},{"line_number":682,"context_line":"      - Unable to update inventory"},{"line_number":683,"context_line":"      - greater than total"},{"line_number":684,"context_line":"  response_json_paths:"},{"line_number":685,"context_line":"      $.errors[0].title: Bad Request"},{"line_number":686,"context_line":""}],"source_content_type":"text/x-yaml","patch_set":1,"id":"9f6a8fd7_c8022d3f","line":683,"range":{"start_line":683,"start_character":8,"end_line":683,"end_character":26},"in_reply_to":"9f6a8fd7_2d7d05e7","updated":"2018-04-28 19:18:46.000000000","message":"yeah i was not sure whether to duplicate all the db and api tests (as in this case they are testing the same calls), so added bits here and there","commit_id":"b6011b4dd1dd8c90749fa819d5704daf9581fce1"}]}
