)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6167,"name":"Ken\u0027ichi Ohmichi","email":"ken1ohmichi@gmail.com","username":"oomichi"},"change_message_id":"4bebe644428cf5464389632314b55f479764c599","unresolved":false,"context_lines":[{"line_number":14,"context_line":""},{"line_number":15,"context_line":"The API reference documentation [2] also says:"},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"\"To disable a device from booting, set the boot index"},{"line_number":18,"context_line":"to a negative value or use the default boot index value,"},{"line_number":19,"context_line":"which is None.\""},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"It appears that with the move to v2.1 and request schema"},{"line_number":22,"context_line":"validation, the boot_index schema was erroneously set to"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"1a430d35_9a98ff79","line":19,"range":{"start_line":17,"start_character":0,"end_line":19,"end_character":15},"updated":"2017-02-08 17:53:30.000000000","message":"boot_index is not \u0027required\u0027 on json-schema definition.\n\nI feel None appears and Nova works fine if not specifying boot_index on an API request. So I guess the part \"the default boot index value\" of the above is saying\n\n If users don\u0027t specify boot_index, Nova disables a device\n from booting as the same behavior as the negative value.","commit_id":"ce7a5e129e8ce0bd9310a4fc5d477181b5d3401a"},{"author":{"_account_id":6167,"name":"Ken\u0027ichi Ohmichi","email":"ken1ohmichi@gmail.com","username":"oomichi"},"change_message_id":"90c89b7bc2a89051b12d530feaac054e27798fe2","unresolved":false,"context_lines":[{"line_number":14,"context_line":""},{"line_number":15,"context_line":"The API reference documentation [2] also says:"},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"\"To disable a device from booting, set the boot index"},{"line_number":18,"context_line":"to a negative value or use the default boot index value,"},{"line_number":19,"context_line":"which is None.\""},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"It appears that with the move to v2.1 and request schema"},{"line_number":22,"context_line":"validation, the boot_index schema was erroneously set to"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"1a430d35_6e9b9818","line":19,"range":{"start_line":17,"start_character":0,"end_line":19,"end_character":15},"in_reply_to":"1a430d35_2ec35058","updated":"2017-02-08 18:24:53.000000000","message":"Yeah, I know this kind of changes between legacy v2 and v2.1.\n\nEspecially block-device-mapping parameters are super difficult to handle due to its complex. Actually there is not special meaning to specify None as boot_index, and we tried to make json-schema definitions simple as possible to clarify the meanings and available values.","commit_id":"ce7a5e129e8ce0bd9310a4fc5d477181b5d3401a"},{"author":{"_account_id":6167,"name":"Ken\u0027ichi Ohmichi","email":"ken1ohmichi@gmail.com","username":"oomichi"},"change_message_id":"18c0e636c91bad22cc50715836a5e2c83193f7bb","unresolved":false,"context_lines":[{"line_number":14,"context_line":""},{"line_number":15,"context_line":"The API reference documentation [2] also says:"},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"\"To disable a device from booting, set the boot index"},{"line_number":18,"context_line":"to a negative value or use the default boot index value,"},{"line_number":19,"context_line":"which is None.\""},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"It appears that with the move to v2.1 and request schema"},{"line_number":22,"context_line":"validation, the boot_index schema was erroneously set to"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"1a430d35_713299a8","line":19,"range":{"start_line":17,"start_character":0,"end_line":19,"end_character":15},"in_reply_to":"1a430d35_6e9b9818","updated":"2017-02-08 18:35:13.000000000","message":"TBH, there is a lot of this kind of change between legacy v2 and v2.1. On legacy v2 development, we faced difficult situation to explain how to specify the default value for users.\n\n Option 1: If users don\u0027t specify the parameter, Nova takes\n           the default behavior.\n Option 2: If users can specify the default parameter value,\n           Nova takes the default behavior.\n\nThis kind of value tends to be None on many APIs, and the code\nlooks like\n\n value \u003d request_body.get(\u0027foo\u0027)\n\nOn the above code, Nova could not distinguish a user specify\nthe parameter \u0027foo\u0027 or not when getting None value, because the API didn\u0027t implement json-schema.\nWhen implementing json-schema on v2.1 API, we have defined json-schema as \u0027non-required\u0027 for such parameters to clean definitions.","commit_id":"ce7a5e129e8ce0bd9310a4fc5d477181b5d3401a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9163c213514a2845dcd4dd3f61b17cd1919584cc","unresolved":false,"context_lines":[{"line_number":14,"context_line":""},{"line_number":15,"context_line":"The API reference documentation [2] also says:"},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"\"To disable a device from booting, set the boot index"},{"line_number":18,"context_line":"to a negative value or use the default boot index value,"},{"line_number":19,"context_line":"which is None.\""},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"It appears that with the move to v2.1 and request schema"},{"line_number":22,"context_line":"validation, the boot_index schema was erroneously set to"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"1a430d35_444ddd98","line":19,"range":{"start_line":17,"start_character":0,"end_line":19,"end_character":15},"in_reply_to":"1a430d35_713299a8","updated":"2017-02-08 19:15:28.000000000","message":"So the alternative to this fix is we basically mark the bug as won\u0027t fix, put out a known issues release note and update the block_device_mapping_v2.boot_index documentation in the api-ref to say that None is not required in the v2.1 API and should be omitted if that\u0027s what your intention is (to accept the defaults). That is a breaking change when moving applications from v2 to v2.1, which is why it worries me.","commit_id":"ce7a5e129e8ce0bd9310a4fc5d477181b5d3401a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"dc26172646abf9e1afbe6fcc8667c5f0318e43ac","unresolved":false,"context_lines":[{"line_number":14,"context_line":""},{"line_number":15,"context_line":"The API reference documentation [2] also says:"},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"\"To disable a device from booting, set the boot index"},{"line_number":18,"context_line":"to a negative value or use the default boot index value,"},{"line_number":19,"context_line":"which is None.\""},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"It appears that with the move to v2.1 and request schema"},{"line_number":22,"context_line":"validation, the boot_index schema was erroneously set to"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"1a430d35_2ec35058","line":19,"range":{"start_line":17,"start_character":0,"end_line":19,"end_character":15},"in_reply_to":"1a430d35_9a98ff79","updated":"2017-02-08 18:16:42.000000000","message":"Sure, but either way, in the v2 API you could specify boot_index\u003dNone and now you can\u0027t without getting a 400 error. That\u0027s a backward incompatible change in behavior, and the v2.1 API should be backward compatible with the v2 API.","commit_id":"ce7a5e129e8ce0bd9310a4fc5d477181b5d3401a"}],"nova/api/openstack/compute/schemas/block_device_mapping.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"08f4d9019caf0db74963349c05cb6dcdd19f6b7a","unresolved":false,"context_lines":[{"line_number":55,"context_line":"    # NOTE(mriedem): boot_index\u003dNone is also accepted for backward"},{"line_number":56,"context_line":"    # compatibility with the legacy v2 API."},{"line_number":57,"context_line":"    \u0027boot_index\u0027: {"},{"line_number":58,"context_line":"        \u0027oneOf\u0027: [{\u0027type\u0027: [\u0027integer\u0027, \u0027string\u0027],"},{"line_number":59,"context_line":"                   \u0027pattern\u0027: \u0027^-?[0-9]+$\u0027},"},{"line_number":60,"context_line":"                  {\u0027type\u0027: \u0027null\u0027}]"},{"line_number":61,"context_line":"    },"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a430d35_521f8907","line":58,"range":{"start_line":58,"start_character":9,"end_line":58,"end_character":14},"updated":"2017-02-08 01:45:46.000000000","message":"I guess I don\u0027t need this, I can just add \u0027null\u0027 to the type list.","commit_id":"a0a63fa20716462cb8ff3be8d1581f3de6673850"}],"nova/block_device.py":[{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"e74992f8299b2f5ac6f203394bf607c8aa2cb867","unresolved":false,"context_lines":[{"line_number":198,"context_line":"            if source_type \u003d\u003d \u0027image\u0027 and destination_type \u003d\u003d \u0027local\u0027:"},{"line_number":199,"context_line":"                try:"},{"line_number":200,"context_line":"                    boot_index \u003d int(api_dict.get(\u0027boot_index\u0027, -1))"},{"line_number":201,"context_line":"                except (ValueError, TypeError):"},{"line_number":202,"context_line":"                    raise exception.InvalidBDMFormat("},{"line_number":203,"context_line":"                        details\u003d_(\"Boot index is invalid.\"))"},{"line_number":204,"context_line":"                # if this bdm is generated from --image ,then"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a430d35_f7722210","line":201,"range":{"start_line":201,"start_character":16,"end_line":201,"end_character":47},"updated":"2017-02-08 05:58:59.000000000","message":"This means when source_type is \u0027image\u0027 and destination_type is local, the boot_index can\u0027t be None.\n\nThis behaviour since kilo https://review.openstack.org/#/c/186976/6/nova/block_device.py","commit_id":"ce7a5e129e8ce0bd9310a4fc5d477181b5d3401a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"49f9c540986645678f2f32a824773bda9bebae32","unresolved":false,"context_lines":[{"line_number":198,"context_line":"            if source_type \u003d\u003d \u0027image\u0027 and destination_type \u003d\u003d \u0027local\u0027:"},{"line_number":199,"context_line":"                try:"},{"line_number":200,"context_line":"                    boot_index \u003d int(api_dict.get(\u0027boot_index\u0027, -1))"},{"line_number":201,"context_line":"                except (ValueError, TypeError):"},{"line_number":202,"context_line":"                    raise exception.InvalidBDMFormat("},{"line_number":203,"context_line":"                        details\u003d_(\"Boot index is invalid.\"))"},{"line_number":204,"context_line":"                # if this bdm is generated from --image ,then"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a430d35_f0ea1173","line":201,"range":{"start_line":201,"start_character":16,"end_line":201,"end_character":47},"in_reply_to":"1a430d35_f7722210","updated":"2017-02-08 14:36:11.000000000","message":"According to the docs here:\n\nhttp://docs.openstack.org/developer/nova/block_device_mapping.html#block-device-mapping-v2\n\n\"image -\u003e local - this is only currently reserved for the entry referring to the Glance image that the instance is being booted with (it should also be marked as a boot device).\"\n\nThat last part about it needing to be marked as a boot device is why I thought it was handling ValueError, but it defaults to -1 if boot_index isn\u0027t provided, and -1 or None means it\u0027s not a boot device. I thought that was handled later here:\n\nhttps://github.com/openstack/nova/blob/d48aeb5783ea9bd9495eb2e7c67bc587dfd7d85d/nova/compute/api.py#L779\n\nBut that\u0027s for image-defined BDMs, not user supplied.\n\nSo I suppose handling TypeError like this here is wrong since we don\u0027t see to validate boot_index as -1 for image-\u003elocal otherwise. TypeError should be acceptable here since it means None which is equivalent to -1.","commit_id":"ce7a5e129e8ce0bd9310a4fc5d477181b5d3401a"},{"author":{"_account_id":6167,"name":"Ken\u0027ichi Ohmichi","email":"ken1ohmichi@gmail.com","username":"oomichi"},"change_message_id":"5d53b5d15dcd5c125ca35ebb91c908a601dece8d","unresolved":false,"context_lines":[{"line_number":202,"context_line":"                    # but it\u0027s meant to handle boot_index not being specified,"},{"line_number":203,"context_line":"                    # boot_index\u003dNone or boot_index\u003d0, and the latter two are"},{"line_number":204,"context_line":"                    # falsey so we need to distinguish the two."},{"line_number":205,"context_line":"                    boot_index \u003d int("},{"line_number":206,"context_line":"                        # None is equivalent to -1."},{"line_number":207,"context_line":"                        -1 if api_dict.get(\u0027boot_index\u0027) is None else"},{"line_number":208,"context_line":"                        # Default to -1 if not specified."},{"line_number":209,"context_line":"                        api_dict.get(\u0027boot_index\u0027, -1))"},{"line_number":210,"context_line":"                except ValueError:"},{"line_number":211,"context_line":"                    raise exception.InvalidBDMFormat("},{"line_number":212,"context_line":"                        details\u003d_(\"Boot index is invalid.\"))"}],"source_content_type":"text/x-python","patch_set":4,"id":"1a430d35_3d854059","line":209,"range":{"start_line":205,"start_character":0,"end_line":209,"end_character":55},"updated":"2017-02-08 20:15:26.000000000","message":"This seems a little gross..\n\nit could be just like\n\n boot_index \u003d api_dict.get(\u0027boot_index\u0027, -1)\n if boot_index is None:\n      # None is equivalent to -1 when specifing None on the API call.\n      boot_index \u003d -1\n boot_index \u003d int(boot_index)","commit_id":"26dde25b2df6b4d1108f637ba0683ed7592a0a7d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"23da230c2d4b0679ff5aa531daae015090e3c331","unresolved":false,"context_lines":[{"line_number":202,"context_line":"                    # but it\u0027s meant to handle boot_index not being specified,"},{"line_number":203,"context_line":"                    # boot_index\u003dNone or boot_index\u003d0, and the latter two are"},{"line_number":204,"context_line":"                    # falsey so we need to distinguish the two."},{"line_number":205,"context_line":"                    boot_index \u003d int("},{"line_number":206,"context_line":"                        # None is equivalent to -1."},{"line_number":207,"context_line":"                        -1 if api_dict.get(\u0027boot_index\u0027) is None else"},{"line_number":208,"context_line":"                        # Default to -1 if not specified."},{"line_number":209,"context_line":"                        api_dict.get(\u0027boot_index\u0027, -1))"},{"line_number":210,"context_line":"                except ValueError:"},{"line_number":211,"context_line":"                    raise exception.InvalidBDMFormat("},{"line_number":212,"context_line":"                        details\u003d_(\"Boot index is invalid.\"))"}],"source_content_type":"text/x-python","patch_set":4,"id":"1a430d35_3d1b8082","line":209,"range":{"start_line":205,"start_character":0,"end_line":209,"end_character":55},"in_reply_to":"1a430d35_3d854059","updated":"2017-02-08 20:36:35.000000000","message":"Thanks. I was hacking on this during a meeting and was struggling to come up with something less stupid than what I have here.","commit_id":"26dde25b2df6b4d1108f637ba0683ed7592a0a7d"}]}
