)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"c359eed953390309e9111266a7415ddb83925ddf","unresolved":false,"context_lines":[{"line_number":12,"context_line":"the nova side this limitation will be lifted."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Note that the api sample tests for server actions needed to split into"},{"line_number":15,"context_line":"two test class. The floating ip tests are moved to a new class as those"},{"line_number":16,"context_line":"tests are not supporting Neutron yet. For the rest neutron is now used"},{"line_number":17,"context_line":"in the test. This was necessary as now the resize action depending on"},{"line_number":18,"context_line":"neutron a neturon only feature, i.e. listing ports."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"9fdfeff1_7085aace","line":15,"range":{"start_line":15,"start_character":9,"end_line":15,"end_character":14},"updated":"2019-01-29 14:16:21.000000000","message":"classes","commit_id":"bbfb3bcf792b0d712ec59259479c8701b1e31722"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"c359eed953390309e9111266a7415ddb83925ddf","unresolved":false,"context_lines":[{"line_number":15,"context_line":"two test class. The floating ip tests are moved to a new class as those"},{"line_number":16,"context_line":"tests are not supporting Neutron yet. For the rest neutron is now used"},{"line_number":17,"context_line":"in the test. This was necessary as now the resize action depending on"},{"line_number":18,"context_line":"neutron a neturon only feature, i.e. listing ports."},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"blueprint: bandwidth-resource-provider"},{"line_number":21,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"9fdfeff1_500bc67b","line":18,"range":{"start_line":18,"start_character":10,"end_line":18,"end_character":17},"updated":"2019-01-29 14:16:21.000000000","message":"Neutron","commit_id":"bbfb3bcf792b0d712ec59259479c8701b1e31722"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"6832126c211a3e748891c3c7b47f95682d1accdf","unresolved":false,"context_lines":[{"line_number":15,"context_line":"two test class. The floating ip tests are moved to a new class as those"},{"line_number":16,"context_line":"tests are not supporting Neutron yet. For the rest neutron is now used"},{"line_number":17,"context_line":"in the test. This was necessary as now the resize action depending on"},{"line_number":18,"context_line":"neutron a neturon only feature, i.e. listing ports."},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"blueprint: bandwidth-resource-provider"},{"line_number":21,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"9fdfeff1_ab4c1742","line":18,"range":{"start_line":18,"start_character":8,"end_line":18,"end_character":9},"updated":"2019-01-28 17:57:40.000000000","message":"is a","commit_id":"bbfb3bcf792b0d712ec59259479c8701b1e31722"}],"nova/api/openstack/common.py":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"c359eed953390309e9111266a7415ddb83925ddf","unresolved":false,"context_lines":[{"line_number":557,"context_line":"    port resource request during move operation."},{"line_number":558,"context_line":""},{"line_number":559,"context_line":"    NOTE: At the moment there is no such microversion that supports port"},{"line_number":560,"context_line":"    resource request during move. This function is added as a preparation for"},{"line_number":561,"context_line":"    that microversion."},{"line_number":562,"context_line":""},{"line_number":563,"context_line":"    :param req: The incoming API request"}],"source_content_type":"text/x-python","patch_set":4,"id":"9fdfeff1_705e0a77","line":560,"range":{"start_line":560,"start_character":20,"end_line":560,"end_character":32},"updated":"2019-01-29 14:16:21.000000000","message":"didn\u0027t @dansmith want to only have a single microversion and not have a microversion for the spawn/greenfield stuff and another microversion for the move operations?","commit_id":"bbfb3bcf792b0d712ec59259479c8701b1e31722"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"7b4b08b62e30f5aa16f870dbb509179064a0a05e","unresolved":false,"context_lines":[{"line_number":557,"context_line":"    port resource request during move operation."},{"line_number":558,"context_line":""},{"line_number":559,"context_line":"    NOTE: At the moment there is no such microversion that supports port"},{"line_number":560,"context_line":"    resource request during move. This function is added as a preparation for"},{"line_number":561,"context_line":"    that microversion."},{"line_number":562,"context_line":""},{"line_number":563,"context_line":"    :param req: The incoming API request"}],"source_content_type":"text/x-python","patch_set":4,"id":"9fdfeff1_f8af3ce0","line":560,"range":{"start_line":560,"start_character":20,"end_line":560,"end_character":32},"in_reply_to":"9fdfeff1_1afd586d","updated":"2019-01-29 17:57:14.000000000","message":"ack. sorry, when I read this, it read like \"there will be a new microversion to indicate that port resource requests work for move operations\".","commit_id":"bbfb3bcf792b0d712ec59259479c8701b1e31722"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"75bbeda453373ac4b17f33f24a5c9a4b7cfc7fc4","unresolved":false,"context_lines":[{"line_number":557,"context_line":"    port resource request during move operation."},{"line_number":558,"context_line":""},{"line_number":559,"context_line":"    NOTE: At the moment there is no such microversion that supports port"},{"line_number":560,"context_line":"    resource request during move. This function is added as a preparation for"},{"line_number":561,"context_line":"    that microversion."},{"line_number":562,"context_line":""},{"line_number":563,"context_line":"    :param req: The incoming API request"}],"source_content_type":"text/x-python","patch_set":4,"id":"9fdfeff1_29820102","line":560,"range":{"start_line":560,"start_character":20,"end_line":560,"end_character":32},"in_reply_to":"9fdfeff1_258a6fbe","updated":"2019-02-04 17:46:39.000000000","message":"Added a caveat to this in a follow up.","commit_id":"bbfb3bcf792b0d712ec59259479c8701b1e31722"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"dbc03d27ed583381fca5f5c3c9f6a5876ffcac2f","unresolved":false,"context_lines":[{"line_number":557,"context_line":"    port resource request during move operation."},{"line_number":558,"context_line":""},{"line_number":559,"context_line":"    NOTE: At the moment there is no such microversion that supports port"},{"line_number":560,"context_line":"    resource request during move. This function is added as a preparation for"},{"line_number":561,"context_line":"    that microversion."},{"line_number":562,"context_line":""},{"line_number":563,"context_line":"    :param req: The incoming API request"}],"source_content_type":"text/x-python","patch_set":4,"id":"9fdfeff1_1afd586d","line":560,"range":{"start_line":560,"start_character":20,"end_line":560,"end_character":32},"in_reply_to":"9fdfeff1_705e0a77","updated":"2019-01-29 16:28:09.000000000","message":"I don\u0027t think that really needs to block this at this point in the series. This is just a feature flag to block attempts until it\u0027s supported. When it\u0027s supported it may be a new microversion or not, but we can defer that decision for now right because currently it\u0027s not supported.","commit_id":"bbfb3bcf792b0d712ec59259479c8701b1e31722"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"caaf20d12ee4ffe8d8cf0357187b5be87b3de0da","unresolved":false,"context_lines":[{"line_number":557,"context_line":"    port resource request during move operation."},{"line_number":558,"context_line":""},{"line_number":559,"context_line":"    NOTE: At the moment there is no such microversion that supports port"},{"line_number":560,"context_line":"    resource request during move. This function is added as a preparation for"},{"line_number":561,"context_line":"    that microversion."},{"line_number":562,"context_line":""},{"line_number":563,"context_line":"    :param req: The incoming API request"}],"source_content_type":"text/x-python","patch_set":4,"id":"9fdfeff1_258a6fbe","line":560,"range":{"start_line":560,"start_character":20,"end_line":560,"end_character":32},"in_reply_to":"9fdfeff1_d81598e6","updated":"2019-01-30 15:34:00.000000000","message":"I\u0027m fine to rephrase things here. My main goal here is to make the move operations rejected in a way that is easy to mock from functional env, like this function.","commit_id":"bbfb3bcf792b0d712ec59259479c8701b1e31722"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"79b7e790b2369144bc251dd36612659782844b23","unresolved":false,"context_lines":[{"line_number":557,"context_line":"    port resource request during move operation."},{"line_number":558,"context_line":""},{"line_number":559,"context_line":"    NOTE: At the moment there is no such microversion that supports port"},{"line_number":560,"context_line":"    resource request during move. This function is added as a preparation for"},{"line_number":561,"context_line":"    that microversion."},{"line_number":562,"context_line":""},{"line_number":563,"context_line":"    :param req: The incoming API request"}],"source_content_type":"text/x-python","patch_set":4,"id":"9fdfeff1_d81598e6","line":560,"range":{"start_line":560,"start_character":20,"end_line":560,"end_character":32},"in_reply_to":"9fdfeff1_f8af3ce0","updated":"2019-01-29 18:05:53.000000000","message":"Yeah it does read that way, but I don\u0027t think it\u0027s set in stone, it\u0027s just going on what we talked about on the call awhile back.","commit_id":"bbfb3bcf792b0d712ec59259479c8701b1e31722"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"6832126c211a3e748891c3c7b47f95682d1accdf","unresolved":false,"context_lines":[{"line_number":571,"context_line":"        context, instance_uuid, network_api):"},{"line_number":572,"context_line":""},{"line_number":573,"context_line":"    search_opts \u003d {\u0027device_id\u0027: instance_uuid}"},{"line_number":574,"context_line":"    ports \u003d network_api.list_ports(context, **search_opts).get(\u0027ports\u0027, [])"},{"line_number":575,"context_line":"    ports_with_resource_request \u003d [port for port in ports"},{"line_number":576,"context_line":"                                   if port.get(\u0027resource_request\u0027, None)]"},{"line_number":577,"context_line":"    return bool(ports_with_resource_request)"}],"source_content_type":"text/x-python","patch_set":4,"id":"9fdfeff1_6b6b8f84","line":574,"updated":"2019-01-28 17:57:40.000000000","message":"This could be optimized to only return the \"resource_request\" field using the fields kwarg to list_ports.","commit_id":"bbfb3bcf792b0d712ec59259479c8701b1e31722"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"c359eed953390309e9111266a7415ddb83925ddf","unresolved":false,"context_lines":[{"line_number":571,"context_line":"        context, instance_uuid, network_api):"},{"line_number":572,"context_line":""},{"line_number":573,"context_line":"    search_opts \u003d {\u0027device_id\u0027: instance_uuid}"},{"line_number":574,"context_line":"    ports \u003d network_api.list_ports(context, **search_opts).get(\u0027ports\u0027, [])"},{"line_number":575,"context_line":"    ports_with_resource_request \u003d [port for port in ports"},{"line_number":576,"context_line":"                                   if port.get(\u0027resource_request\u0027, None)]"},{"line_number":577,"context_line":"    return bool(ports_with_resource_request)"}],"source_content_type":"text/x-python","patch_set":4,"id":"9fdfeff1_f0499ab6","line":574,"in_reply_to":"9fdfeff1_6b6b8f84","updated":"2019-01-29 14:16:21.000000000","message":"+1","commit_id":"bbfb3bcf792b0d712ec59259479c8701b1e31722"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"caaf20d12ee4ffe8d8cf0357187b5be87b3de0da","unresolved":false,"context_lines":[{"line_number":571,"context_line":"        context, instance_uuid, network_api):"},{"line_number":572,"context_line":""},{"line_number":573,"context_line":"    search_opts \u003d {\u0027device_id\u0027: instance_uuid}"},{"line_number":574,"context_line":"    ports \u003d network_api.list_ports(context, **search_opts).get(\u0027ports\u0027, [])"},{"line_number":575,"context_line":"    ports_with_resource_request \u003d [port for port in ports"},{"line_number":576,"context_line":"                                   if port.get(\u0027resource_request\u0027, None)]"},{"line_number":577,"context_line":"    return bool(ports_with_resource_request)"}],"source_content_type":"text/x-python","patch_set":4,"id":"9fdfeff1_75859cce","line":574,"in_reply_to":"9fdfeff1_6b6b8f84","updated":"2019-01-30 15:34:00.000000000","message":"I know that fields\u003d[] kwargs works for show_port but I haven\u0027t seen it used with list_ports.\n\nWould it really only load requested fields of the ports from neutron via the REST API?","commit_id":"bbfb3bcf792b0d712ec59259479c8701b1e31722"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c30b192be752d0e9943e36124eafe1da2ace6f39","unresolved":false,"context_lines":[{"line_number":571,"context_line":"        context, instance_uuid, network_api):"},{"line_number":572,"context_line":""},{"line_number":573,"context_line":"    search_opts \u003d {\u0027device_id\u0027: instance_uuid}"},{"line_number":574,"context_line":"    ports \u003d network_api.list_ports(context, **search_opts).get(\u0027ports\u0027, [])"},{"line_number":575,"context_line":"    ports_with_resource_request \u003d [port for port in ports"},{"line_number":576,"context_line":"                                   if port.get(\u0027resource_request\u0027, None)]"},{"line_number":577,"context_line":"    return bool(ports_with_resource_request)"}],"source_content_type":"text/x-python","patch_set":4,"id":"9fdfeff1_c52043af","line":574,"in_reply_to":"9fdfeff1_75859cce","updated":"2019-01-30 15:39:56.000000000","message":"\u003e I know that fields\u003d[] kwargs works for show_port but I haven\u0027t seen\n \u003e it used with list_ports.\n\nThe API reference example suggests it\u0027s possible:\n\nhttps://developer.openstack.org/api-ref/network/v2/index.html#note\n\n \u003e \n \u003e Would it really only load requested fields of the ports from\n \u003e neutron via the REST API?\n\nThat\u0027s a question for the neutron team, I\u0027m not sure how they filter, i.e. in the DB API query to only load selected columns or post-query filtering in the API code.","commit_id":"bbfb3bcf792b0d712ec59259479c8701b1e31722"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"533c2a10a1a69396f170f420979503b018b372be","unresolved":false,"context_lines":[{"line_number":571,"context_line":"        context, instance_uuid, network_api):"},{"line_number":572,"context_line":""},{"line_number":573,"context_line":"    search_opts \u003d {\u0027device_id\u0027: instance_uuid}"},{"line_number":574,"context_line":"    ports \u003d network_api.list_ports(context, **search_opts).get(\u0027ports\u0027, [])"},{"line_number":575,"context_line":"    ports_with_resource_request \u003d [port for port in ports"},{"line_number":576,"context_line":"                                   if port.get(\u0027resource_request\u0027, None)]"},{"line_number":577,"context_line":"    return bool(ports_with_resource_request)"}],"source_content_type":"text/x-python","patch_set":4,"id":"9fdfeff1_e0c21534","line":574,"in_reply_to":"9fdfeff1_c52043af","updated":"2019-01-30 15:59:24.000000000","message":"OK, the API doc convinced me that it should work.","commit_id":"bbfb3bcf792b0d712ec59259479c8701b1e31722"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"75bbeda453373ac4b17f33f24a5c9a4b7cfc7fc4","unresolved":false,"context_lines":[{"line_number":571,"context_line":"        context, instance_uuid, network_api):"},{"line_number":572,"context_line":""},{"line_number":573,"context_line":"    search_opts \u003d {\u0027device_id\u0027: instance_uuid}"},{"line_number":574,"context_line":"    ports \u003d network_api.list_ports(context, **search_opts).get(\u0027ports\u0027, [])"},{"line_number":575,"context_line":"    ports_with_resource_request \u003d [port for port in ports"},{"line_number":576,"context_line":"                                   if port.get(\u0027resource_request\u0027, None)]"},{"line_number":577,"context_line":"    return bool(ports_with_resource_request)"}],"source_content_type":"text/x-python","patch_set":4,"id":"9fdfeff1_499c255d","line":574,"in_reply_to":"9fdfeff1_e0c21534","updated":"2019-02-04 17:46:39.000000000","message":"Done","commit_id":"bbfb3bcf792b0d712ec59259479c8701b1e31722"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"6832126c211a3e748891c3c7b47f95682d1accdf","unresolved":false,"context_lines":[{"line_number":573,"context_line":"    search_opts \u003d {\u0027device_id\u0027: instance_uuid}"},{"line_number":574,"context_line":"    ports \u003d network_api.list_ports(context, **search_opts).get(\u0027ports\u0027, [])"},{"line_number":575,"context_line":"    ports_with_resource_request \u003d [port for port in ports"},{"line_number":576,"context_line":"                                   if port.get(\u0027resource_request\u0027, None)]"},{"line_number":577,"context_line":"    return bool(ports_with_resource_request)"}],"source_content_type":"text/x-python","patch_set":4,"id":"9fdfeff1_ebb3ff08","line":576,"updated":"2019-01-28 17:57:40.000000000","message":"Could just return True once you hit a port:\n\nfor port in ports:\n   if port.get(\u0027resource_request\u0027):\n      return True\nreturn False","commit_id":"bbfb3bcf792b0d712ec59259479c8701b1e31722"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"caaf20d12ee4ffe8d8cf0357187b5be87b3de0da","unresolved":false,"context_lines":[{"line_number":573,"context_line":"    search_opts \u003d {\u0027device_id\u0027: instance_uuid}"},{"line_number":574,"context_line":"    ports \u003d network_api.list_ports(context, **search_opts).get(\u0027ports\u0027, [])"},{"line_number":575,"context_line":"    ports_with_resource_request \u003d [port for port in ports"},{"line_number":576,"context_line":"                                   if port.get(\u0027resource_request\u0027, None)]"},{"line_number":577,"context_line":"    return bool(ports_with_resource_request)"}],"source_content_type":"text/x-python","patch_set":4,"id":"9fdfeff1_e58f87ca","line":576,"in_reply_to":"9fdfeff1_50e746ad","updated":"2019-01-30 15:34:00.000000000","message":"yeah, make sense.","commit_id":"bbfb3bcf792b0d712ec59259479c8701b1e31722"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"75bbeda453373ac4b17f33f24a5c9a4b7cfc7fc4","unresolved":false,"context_lines":[{"line_number":573,"context_line":"    search_opts \u003d {\u0027device_id\u0027: instance_uuid}"},{"line_number":574,"context_line":"    ports \u003d network_api.list_ports(context, **search_opts).get(\u0027ports\u0027, [])"},{"line_number":575,"context_line":"    ports_with_resource_request \u003d [port for port in ports"},{"line_number":576,"context_line":"                                   if port.get(\u0027resource_request\u0027, None)]"},{"line_number":577,"context_line":"    return bool(ports_with_resource_request)"}],"source_content_type":"text/x-python","patch_set":4,"id":"9fdfeff1_49b505cd","line":576,"in_reply_to":"9fdfeff1_e58f87ca","updated":"2019-02-04 17:46:39.000000000","message":"Done","commit_id":"bbfb3bcf792b0d712ec59259479c8701b1e31722"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"c359eed953390309e9111266a7415ddb83925ddf","unresolved":false,"context_lines":[{"line_number":573,"context_line":"    search_opts \u003d {\u0027device_id\u0027: instance_uuid}"},{"line_number":574,"context_line":"    ports \u003d network_api.list_ports(context, **search_opts).get(\u0027ports\u0027, [])"},{"line_number":575,"context_line":"    ports_with_resource_request \u003d [port for port in ports"},{"line_number":576,"context_line":"                                   if port.get(\u0027resource_request\u0027, None)]"},{"line_number":577,"context_line":"    return bool(ports_with_resource_request)"}],"source_content_type":"text/x-python","patch_set":4,"id":"9fdfeff1_50e746ad","line":576,"in_reply_to":"9fdfeff1_ebb3ff08","updated":"2019-01-29 14:16:21.000000000","message":"+1\n\nor:\n\n return any(port for port in ports if port.get(\u0027resource_request\u0027))","commit_id":"bbfb3bcf792b0d712ec59259479c8701b1e31722"}],"nova/api/openstack/compute/servers.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"6832126c211a3e748891c3c7b47f95682d1accdf","unresolved":false,"context_lines":[{"line_number":808,"context_line":"                    target\u003d{\u0027user_id\u0027: instance.user_id,"},{"line_number":809,"context_line":"                            \u0027project_id\u0027: instance.project_id})"},{"line_number":810,"context_line":""},{"line_number":811,"context_line":"        if (common.instance_has_port_with_resource_request("},{"line_number":812,"context_line":"                    context, instance_id, self.network_api) and not"},{"line_number":813,"context_line":"                common.supports_port_resource_request_during_move(req)):"},{"line_number":814,"context_line":"            msg \u003d _(\"The resize server operation with port having QoS policy \""}],"source_content_type":"text/x-python","patch_set":4,"id":"9fdfeff1_8b99137a","line":811,"updated":"2019-01-28 17:57:40.000000000","message":"It kind of sucks that we have to call this so early but I don\u0027t think we have any obvious places in the API resize method where we get ports so we could just piggyback on that for the validation.\n\nDo we store the port resource request information in the info cache at all? If so, we could just check the info cache rather than doing a GET /ports from neutron which would be better for performance. Could also be a TODO for later if there is a need to store that information in the info cache (I feel like we\u0027ve talked about using the info cache for a few things in this series).","commit_id":"bbfb3bcf792b0d712ec59259479c8701b1e31722"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c30b192be752d0e9943e36124eafe1da2ace6f39","unresolved":false,"context_lines":[{"line_number":808,"context_line":"                    target\u003d{\u0027user_id\u0027: instance.user_id,"},{"line_number":809,"context_line":"                            \u0027project_id\u0027: instance.project_id})"},{"line_number":810,"context_line":""},{"line_number":811,"context_line":"        if (common.instance_has_port_with_resource_request("},{"line_number":812,"context_line":"                    context, instance_id, self.network_api) and not"},{"line_number":813,"context_line":"                common.supports_port_resource_request_during_move(req)):"},{"line_number":814,"context_line":"            msg \u003d _(\"The resize server operation with port having QoS policy \""}],"source_content_type":"text/x-python","patch_set":4,"id":"9fdfeff1_800b0922","line":811,"in_reply_to":"9fdfeff1_30208248","updated":"2019-01-30 15:39:56.000000000","message":"\u003e What if we move this check to the conductor to the place where we will need to read the ports to generate the allocaton_candidate request anyhow? For that we would need to pass the microversion info down to the conductor.\n\nWe could, it gets a bit messy. I would probably opt to only pass a flag from this code to the API.resize method and from there set an unpersisted flag on the RequestSpec to tell conductor what to do. I think for now we can probably leave this as-is and optimize later by either moving the check to later (conductor) or leverage the info cache so we don\u0027t have to do the extra GET /ports call in the API.","commit_id":"bbfb3bcf792b0d712ec59259479c8701b1e31722"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"75bbeda453373ac4b17f33f24a5c9a4b7cfc7fc4","unresolved":false,"context_lines":[{"line_number":808,"context_line":"                    target\u003d{\u0027user_id\u0027: instance.user_id,"},{"line_number":809,"context_line":"                            \u0027project_id\u0027: instance.project_id})"},{"line_number":810,"context_line":""},{"line_number":811,"context_line":"        if (common.instance_has_port_with_resource_request("},{"line_number":812,"context_line":"                    context, instance_id, self.network_api) and not"},{"line_number":813,"context_line":"                common.supports_port_resource_request_during_move(req)):"},{"line_number":814,"context_line":"            msg \u003d _(\"The resize server operation with port having QoS policy \""}],"source_content_type":"text/x-python","patch_set":4,"id":"9fdfeff1_c971f50e","line":811,"in_reply_to":"9fdfeff1_40a1a193","updated":"2019-02-04 17:46:39.000000000","message":"I left a comment in the code in a follow up.","commit_id":"bbfb3bcf792b0d712ec59259479c8701b1e31722"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"533c2a10a1a69396f170f420979503b018b372be","unresolved":false,"context_lines":[{"line_number":808,"context_line":"                    target\u003d{\u0027user_id\u0027: instance.user_id,"},{"line_number":809,"context_line":"                            \u0027project_id\u0027: instance.project_id})"},{"line_number":810,"context_line":""},{"line_number":811,"context_line":"        if (common.instance_has_port_with_resource_request("},{"line_number":812,"context_line":"                    context, instance_id, self.network_api) and not"},{"line_number":813,"context_line":"                common.supports_port_resource_request_during_move(req)):"},{"line_number":814,"context_line":"            msg \u003d _(\"The resize server operation with port having QoS policy \""}],"source_content_type":"text/x-python","patch_set":4,"id":"9fdfeff1_40a1a193","line":811,"in_reply_to":"9fdfeff1_800b0922","updated":"2019-01-30 15:59:24.000000000","message":"I agree to figure out what to do when we have the patch that makes resize working.","commit_id":"bbfb3bcf792b0d712ec59259479c8701b1e31722"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"caaf20d12ee4ffe8d8cf0357187b5be87b3de0da","unresolved":false,"context_lines":[{"line_number":808,"context_line":"                    target\u003d{\u0027user_id\u0027: instance.user_id,"},{"line_number":809,"context_line":"                            \u0027project_id\u0027: instance.project_id})"},{"line_number":810,"context_line":""},{"line_number":811,"context_line":"        if (common.instance_has_port_with_resource_request("},{"line_number":812,"context_line":"                    context, instance_id, self.network_api) and not"},{"line_number":813,"context_line":"                common.supports_port_resource_request_during_move(req)):"},{"line_number":814,"context_line":"            msg \u003d _(\"The resize server operation with port having QoS policy \""}],"source_content_type":"text/x-python","patch_set":4,"id":"9fdfeff1_30208248","line":811,"in_reply_to":"9fdfeff1_8b99137a","updated":"2019-01-30 15:34:00.000000000","message":"\u003e It kind of sucks that we have to call this so early but I don\u0027t\n \u003e think we have any obvious places in the API resize method where we\n \u003e get ports so we could just piggyback on that for the validation.\n \u003e \n\nI reached the same conclusion when looked through that code.\n\n \u003e Do we store the port resource request information in the info cache\n \u003e at all? If so, we could just check the info cache rather than doing\n \u003e a GET /ports from neutron which would be better for performance.\n \u003e Could also be a TODO for later if there is a need to store that\n \u003e information in the info cache (I feel like we\u0027ve talked about using\n \u003e the info cache for a few things in this series).\n\nI didn\u0027t put anything about resource request into the info cache for the same reason as why I\u0027m not persisting such information in the RequestSpec either.\n\nUntil now I assumed that during resize/migrate we only need to read the ports once when prepare the scheduling request. But you are right. When we start supporting resize we will read the ports twice. Once here for this check and the second time somewhere in the conductor.\n\nWhat if we move this check to the conductor to the place where we will need to read the ports to generate the allocaton_candidate request anyhow? For that we would need to pass the microversion info down to the conductor.","commit_id":"bbfb3bcf792b0d712ec59259479c8701b1e31722"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"6832126c211a3e748891c3c7b47f95682d1accdf","unresolved":false,"context_lines":[{"line_number":811,"context_line":"        if (common.instance_has_port_with_resource_request("},{"line_number":812,"context_line":"                    context, instance_id, self.network_api) and not"},{"line_number":813,"context_line":"                common.supports_port_resource_request_during_move(req)):"},{"line_number":814,"context_line":"            msg \u003d _(\"The resize server operation with port having QoS policy \""},{"line_number":815,"context_line":"                    \"is not supported.\")"},{"line_number":816,"context_line":"            raise exc.HTTPBadRequest(explanation\u003dmsg)"},{"line_number":817,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"9fdfeff1_eba8df8c","line":814,"range":{"start_line":814,"start_character":66,"end_line":814,"end_character":69},"updated":"2019-01-28 17:57:40.000000000","message":"Same nit as https://review.openstack.org/#/c/630721/4/nova/exception.py@2157 in that we might want to make this more generic if you can still somehow work QoS into the error message as an example.","commit_id":"bbfb3bcf792b0d712ec59259479c8701b1e31722"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"caaf20d12ee4ffe8d8cf0357187b5be87b3de0da","unresolved":false,"context_lines":[{"line_number":811,"context_line":"        if (common.instance_has_port_with_resource_request("},{"line_number":812,"context_line":"                    context, instance_id, self.network_api) and not"},{"line_number":813,"context_line":"                common.supports_port_resource_request_during_move(req)):"},{"line_number":814,"context_line":"            msg \u003d _(\"The resize server operation with port having QoS policy \""},{"line_number":815,"context_line":"                    \"is not supported.\")"},{"line_number":816,"context_line":"            raise exc.HTTPBadRequest(explanation\u003dmsg)"},{"line_number":817,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"9fdfeff1_f098ba75","line":814,"range":{"start_line":814,"start_character":66,"end_line":814,"end_character":69},"in_reply_to":"9fdfeff1_eba8df8c","updated":"2019-01-30 15:34:00.000000000","message":"make sense","commit_id":"bbfb3bcf792b0d712ec59259479c8701b1e31722"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"75bbeda453373ac4b17f33f24a5c9a4b7cfc7fc4","unresolved":false,"context_lines":[{"line_number":811,"context_line":"        if (common.instance_has_port_with_resource_request("},{"line_number":812,"context_line":"                    context, instance_id, self.network_api) and not"},{"line_number":813,"context_line":"                common.supports_port_resource_request_during_move(req)):"},{"line_number":814,"context_line":"            msg \u003d _(\"The resize server operation with port having QoS policy \""},{"line_number":815,"context_line":"                    \"is not supported.\")"},{"line_number":816,"context_line":"            raise exc.HTTPBadRequest(explanation\u003dmsg)"},{"line_number":817,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"9fdfeff1_c91c95c3","line":814,"range":{"start_line":814,"start_character":66,"end_line":814,"end_character":69},"in_reply_to":"9fdfeff1_f098ba75","updated":"2019-02-04 17:46:39.000000000","message":"Done","commit_id":"bbfb3bcf792b0d712ec59259479c8701b1e31722"}],"nova/tests/functional/test_servers.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"6832126c211a3e748891c3c7b47f95682d1accdf","unresolved":false,"context_lines":[{"line_number":5467,"context_line":""},{"line_number":5468,"context_line":"        # We need to simulate that the above server has a port that has"},{"line_number":5469,"context_line":"        # resource request, we cannot boot with such a port but legacy servers"},{"line_number":5470,"context_line":"        # can exists with such a port."},{"line_number":5471,"context_line":"        bound_port \u003d self.neutron._ports[self.neutron.port_1[\u0027id\u0027]]"},{"line_number":5472,"context_line":"        fake_resource_request \u003d self.neutron.port_with_resource_request["},{"line_number":5473,"context_line":"            \u0027resource_request\u0027]"}],"source_content_type":"text/x-python","patch_set":4,"id":"9fdfeff1_8b4353af","line":5470,"range":{"start_line":5470,"start_character":14,"end_line":5470,"end_character":20},"updated":"2019-01-28 17:57:40.000000000","message":"exist","commit_id":"bbfb3bcf792b0d712ec59259479c8701b1e31722"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"75bbeda453373ac4b17f33f24a5c9a4b7cfc7fc4","unresolved":false,"context_lines":[{"line_number":5467,"context_line":""},{"line_number":5468,"context_line":"        # We need to simulate that the above server has a port that has"},{"line_number":5469,"context_line":"        # resource request, we cannot boot with such a port but legacy servers"},{"line_number":5470,"context_line":"        # can exists with such a port."},{"line_number":5471,"context_line":"        bound_port \u003d self.neutron._ports[self.neutron.port_1[\u0027id\u0027]]"},{"line_number":5472,"context_line":"        fake_resource_request \u003d self.neutron.port_with_resource_request["},{"line_number":5473,"context_line":"            \u0027resource_request\u0027]"}],"source_content_type":"text/x-python","patch_set":4,"id":"9fdfeff1_c94a55ab","line":5470,"range":{"start_line":5470,"start_character":14,"end_line":5470,"end_character":20},"in_reply_to":"9fdfeff1_8b4353af","updated":"2019-02-04 17:46:39.000000000","message":"Done","commit_id":"bbfb3bcf792b0d712ec59259479c8701b1e31722"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"6832126c211a3e748891c3c7b47f95682d1accdf","unresolved":false,"context_lines":[{"line_number":5468,"context_line":"        # We need to simulate that the above server has a port that has"},{"line_number":5469,"context_line":"        # resource request, we cannot boot with such a port but legacy servers"},{"line_number":5470,"context_line":"        # can exists with such a port."},{"line_number":5471,"context_line":"        bound_port \u003d self.neutron._ports[self.neutron.port_1[\u0027id\u0027]]"},{"line_number":5472,"context_line":"        fake_resource_request \u003d self.neutron.port_with_resource_request["},{"line_number":5473,"context_line":"            \u0027resource_request\u0027]"},{"line_number":5474,"context_line":"        bound_port[\u0027resource_request\u0027] \u003d fake_resource_request"},{"line_number":5475,"context_line":""},{"line_number":5476,"context_line":"        resize_req \u003d {"},{"line_number":5477,"context_line":"            \u0027resize\u0027: {"}],"source_content_type":"text/x-python","patch_set":4,"id":"9fdfeff1_eb0bff79","line":5474,"range":{"start_line":5471,"start_character":8,"end_line":5474,"end_character":62},"updated":"2019-01-28 17:57:40.000000000","message":"This seems like it could be racy later if something else is using the fixture, but hopefully none of that is global...","commit_id":"bbfb3bcf792b0d712ec59259479c8701b1e31722"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"caaf20d12ee4ffe8d8cf0357187b5be87b3de0da","unresolved":false,"context_lines":[{"line_number":5468,"context_line":"        # We need to simulate that the above server has a port that has"},{"line_number":5469,"context_line":"        # resource request, we cannot boot with such a port but legacy servers"},{"line_number":5470,"context_line":"        # can exists with such a port."},{"line_number":5471,"context_line":"        bound_port \u003d self.neutron._ports[self.neutron.port_1[\u0027id\u0027]]"},{"line_number":5472,"context_line":"        fake_resource_request \u003d self.neutron.port_with_resource_request["},{"line_number":5473,"context_line":"            \u0027resource_request\u0027]"},{"line_number":5474,"context_line":"        bound_port[\u0027resource_request\u0027] \u003d fake_resource_request"},{"line_number":5475,"context_line":""},{"line_number":5476,"context_line":"        resize_req \u003d {"},{"line_number":5477,"context_line":"            \u0027resize\u0027: {"}],"source_content_type":"text/x-python","patch_set":4,"id":"9fdfeff1_04a18394","line":5474,"range":{"start_line":5471,"start_character":8,"end_line":5474,"end_character":62},"in_reply_to":"9fdfeff1_9064ce23","updated":"2019-01-30 15:34:00.000000000","message":"Could be a unit test, but when we will start support this functionality it will be nice to have two functional tests one with the old and one with the new api microversion. Or if we go with one microversion then this functional test can be updated to have a full resize tests after nova supports that.","commit_id":"bbfb3bcf792b0d712ec59259479c8701b1e31722"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"75bbeda453373ac4b17f33f24a5c9a4b7cfc7fc4","unresolved":false,"context_lines":[{"line_number":5468,"context_line":"        # We need to simulate that the above server has a port that has"},{"line_number":5469,"context_line":"        # resource request, we cannot boot with such a port but legacy servers"},{"line_number":5470,"context_line":"        # can exists with such a port."},{"line_number":5471,"context_line":"        bound_port \u003d self.neutron._ports[self.neutron.port_1[\u0027id\u0027]]"},{"line_number":5472,"context_line":"        fake_resource_request \u003d self.neutron.port_with_resource_request["},{"line_number":5473,"context_line":"            \u0027resource_request\u0027]"},{"line_number":5474,"context_line":"        bound_port[\u0027resource_request\u0027] \u003d fake_resource_request"},{"line_number":5475,"context_line":""},{"line_number":5476,"context_line":"        resize_req \u003d {"},{"line_number":5477,"context_line":"            \u0027resize\u0027: {"}],"source_content_type":"text/x-python","patch_set":4,"id":"9fdfeff1_69bc896c","line":5474,"range":{"start_line":5471,"start_character":8,"end_line":5474,"end_character":62},"in_reply_to":"9fdfeff1_d08fb6ca","updated":"2019-02-04 17:46:39.000000000","message":"Done","commit_id":"bbfb3bcf792b0d712ec59259479c8701b1e31722"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"c359eed953390309e9111266a7415ddb83925ddf","unresolved":false,"context_lines":[{"line_number":5468,"context_line":"        # We need to simulate that the above server has a port that has"},{"line_number":5469,"context_line":"        # resource request, we cannot boot with such a port but legacy servers"},{"line_number":5470,"context_line":"        # can exists with such a port."},{"line_number":5471,"context_line":"        bound_port \u003d self.neutron._ports[self.neutron.port_1[\u0027id\u0027]]"},{"line_number":5472,"context_line":"        fake_resource_request \u003d self.neutron.port_with_resource_request["},{"line_number":5473,"context_line":"            \u0027resource_request\u0027]"},{"line_number":5474,"context_line":"        bound_port[\u0027resource_request\u0027] \u003d fake_resource_request"},{"line_number":5475,"context_line":""},{"line_number":5476,"context_line":"        resize_req \u003d {"},{"line_number":5477,"context_line":"            \u0027resize\u0027: {"}],"source_content_type":"text/x-python","patch_set":4,"id":"9fdfeff1_9064ce23","line":5474,"range":{"start_line":5471,"start_character":8,"end_line":5474,"end_character":62},"in_reply_to":"9fdfeff1_eb0bff79","updated":"2019-01-29 14:16:21.000000000","message":"This also seems like a unit test to me, not really a functional test.","commit_id":"bbfb3bcf792b0d712ec59259479c8701b1e31722"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"caaf20d12ee4ffe8d8cf0357187b5be87b3de0da","unresolved":false,"context_lines":[{"line_number":5468,"context_line":"        # We need to simulate that the above server has a port that has"},{"line_number":5469,"context_line":"        # resource request, we cannot boot with such a port but legacy servers"},{"line_number":5470,"context_line":"        # can exists with such a port."},{"line_number":5471,"context_line":"        bound_port \u003d self.neutron._ports[self.neutron.port_1[\u0027id\u0027]]"},{"line_number":5472,"context_line":"        fake_resource_request \u003d self.neutron.port_with_resource_request["},{"line_number":5473,"context_line":"            \u0027resource_request\u0027]"},{"line_number":5474,"context_line":"        bound_port[\u0027resource_request\u0027] \u003d fake_resource_request"},{"line_number":5475,"context_line":""},{"line_number":5476,"context_line":"        resize_req \u003d {"},{"line_number":5477,"context_line":"            \u0027resize\u0027: {"}],"source_content_type":"text/x-python","patch_set":4,"id":"9fdfeff1_d08fb6ca","line":5474,"range":{"start_line":5471,"start_character":8,"end_line":5474,"end_character":62},"in_reply_to":"9fdfeff1_eb0bff79","updated":"2019-01-30 15:34:00.000000000","message":"self.neutron._ports contains a copy of each port so it is safe to modify that for a given test. See https://github.com/openstack/nova/blob/5025c742902d35e5c56a71a11b3a49dcef71c060/nova/tests/fixtures.py#L1313\n\nAnyhow this needs some explanation and as you noted in a later patch is would be nice to factor it out to a separate util. Something like this:\n\n    def _add_resource_request_to_a_bound_port(self, port_id, resource_request):\n        # NOTE(gibi): self.neutron._ports contains a copy of each neutron port\n        # define on class level in the fixture. So modifying what is in the\n        # _ports list is safe as it is re-created for each Neutron fixture\n        # instance therefore for each individual test using that fixture.\n        bound_port \u003d self.neutron._ports[port_id]\n        bound_port[\u0027resource_request\u0027] \u003d resource_request","commit_id":"bbfb3bcf792b0d712ec59259479c8701b1e31722"}],"nova/tests/unit/api/openstack/compute/test_server_actions.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"6832126c211a3e748891c3c7b47f95682d1accdf","unresolved":false,"context_lines":[{"line_number":83,"context_line":"        self.context \u003d self.req.environ[\u0027nova.context\u0027]"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"        self.image_api \u003d image.API()"},{"line_number":86,"context_line":"        # Assume that anything that hits the compute API and looks for a"},{"line_number":87,"context_line":"        # RequestSpec doesn\u0027t care about it, since testing logic that deep"},{"line_number":88,"context_line":"        # should be done in nova.tests.unit.compute.test_compute_api."},{"line_number":89,"context_line":"        mock_reqspec \u003d mock.patch(\u0027nova.objects.RequestSpec\u0027)"},{"line_number":90,"context_line":"        mock_reqspec.start()"},{"line_number":91,"context_line":"        self.addCleanup(mock_reqspec.stop)"},{"line_number":92,"context_line":"        # Similarly we shouldn\u0027t care about anything hitting conductor from"},{"line_number":93,"context_line":"        # these tests."},{"line_number":94,"context_line":"        mock_conductor \u003d mock.patch.object("},{"line_number":95,"context_line":"            self.controller.compute_api, \u0027compute_task_api\u0027)"},{"line_number":96,"context_line":"        mock_conductor.start()"},{"line_number":97,"context_line":"        self.addCleanup(mock_conductor.stop)"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"    def _get_controller(self):"},{"line_number":100,"context_line":"        return self.servers.ServersController()"}],"source_content_type":"text/x-python","patch_set":4,"id":"9fdfeff1_eb59bf8d","line":97,"range":{"start_line":86,"start_character":8,"end_line":97,"end_character":44},"updated":"2019-01-28 17:57:40.000000000","message":"As noted below, you could just handle that mock in a single location so it doesn\u0027t have to be copied to so many tests.","commit_id":"bbfb3bcf792b0d712ec59259479c8701b1e31722"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"caaf20d12ee4ffe8d8cf0357187b5be87b3de0da","unresolved":false,"context_lines":[{"line_number":83,"context_line":"        self.context \u003d self.req.environ[\u0027nova.context\u0027]"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"        self.image_api \u003d image.API()"},{"line_number":86,"context_line":"        # Assume that anything that hits the compute API and looks for a"},{"line_number":87,"context_line":"        # RequestSpec doesn\u0027t care about it, since testing logic that deep"},{"line_number":88,"context_line":"        # should be done in nova.tests.unit.compute.test_compute_api."},{"line_number":89,"context_line":"        mock_reqspec \u003d mock.patch(\u0027nova.objects.RequestSpec\u0027)"},{"line_number":90,"context_line":"        mock_reqspec.start()"},{"line_number":91,"context_line":"        self.addCleanup(mock_reqspec.stop)"},{"line_number":92,"context_line":"        # Similarly we shouldn\u0027t care about anything hitting conductor from"},{"line_number":93,"context_line":"        # these tests."},{"line_number":94,"context_line":"        mock_conductor \u003d mock.patch.object("},{"line_number":95,"context_line":"            self.controller.compute_api, \u0027compute_task_api\u0027)"},{"line_number":96,"context_line":"        mock_conductor.start()"},{"line_number":97,"context_line":"        self.addCleanup(mock_conductor.stop)"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"    def _get_controller(self):"},{"line_number":100,"context_line":"        return self.servers.ServersController()"}],"source_content_type":"text/x-python","patch_set":4,"id":"9fdfeff1_c4ea9bd6","line":97,"range":{"start_line":86,"start_character":8,"end_line":97,"end_character":44},"in_reply_to":"9fdfeff1_0b70c3db","updated":"2019-01-30 15:34:00.000000000","message":"Done","commit_id":"bbfb3bcf792b0d712ec59259479c8701b1e31722"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"75bbeda453373ac4b17f33f24a5c9a4b7cfc7fc4","unresolved":false,"context_lines":[{"line_number":83,"context_line":"        self.context \u003d self.req.environ[\u0027nova.context\u0027]"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"        self.image_api \u003d image.API()"},{"line_number":86,"context_line":"        # Assume that anything that hits the compute API and looks for a"},{"line_number":87,"context_line":"        # RequestSpec doesn\u0027t care about it, since testing logic that deep"},{"line_number":88,"context_line":"        # should be done in nova.tests.unit.compute.test_compute_api."},{"line_number":89,"context_line":"        mock_reqspec \u003d mock.patch(\u0027nova.objects.RequestSpec\u0027)"},{"line_number":90,"context_line":"        mock_reqspec.start()"},{"line_number":91,"context_line":"        self.addCleanup(mock_reqspec.stop)"},{"line_number":92,"context_line":"        # Similarly we shouldn\u0027t care about anything hitting conductor from"},{"line_number":93,"context_line":"        # these tests."},{"line_number":94,"context_line":"        mock_conductor \u003d mock.patch.object("},{"line_number":95,"context_line":"            self.controller.compute_api, \u0027compute_task_api\u0027)"},{"line_number":96,"context_line":"        mock_conductor.start()"},{"line_number":97,"context_line":"        self.addCleanup(mock_conductor.stop)"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"    def _get_controller(self):"},{"line_number":100,"context_line":"        return self.servers.ServersController()"}],"source_content_type":"text/x-python","patch_set":4,"id":"9fdfeff1_84a434bb","line":97,"range":{"start_line":86,"start_character":8,"end_line":97,"end_character":44},"in_reply_to":"9fdfeff1_c4ea9bd6","updated":"2019-02-04 17:46:39.000000000","message":"Done","commit_id":"bbfb3bcf792b0d712ec59259479c8701b1e31722"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"b4a7601cfc4cb90bc147b1c531b611c5b99bda9a","unresolved":false,"context_lines":[{"line_number":83,"context_line":"        self.context \u003d self.req.environ[\u0027nova.context\u0027]"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"        self.image_api \u003d image.API()"},{"line_number":86,"context_line":"        # Assume that anything that hits the compute API and looks for a"},{"line_number":87,"context_line":"        # RequestSpec doesn\u0027t care about it, since testing logic that deep"},{"line_number":88,"context_line":"        # should be done in nova.tests.unit.compute.test_compute_api."},{"line_number":89,"context_line":"        mock_reqspec \u003d mock.patch(\u0027nova.objects.RequestSpec\u0027)"},{"line_number":90,"context_line":"        mock_reqspec.start()"},{"line_number":91,"context_line":"        self.addCleanup(mock_reqspec.stop)"},{"line_number":92,"context_line":"        # Similarly we shouldn\u0027t care about anything hitting conductor from"},{"line_number":93,"context_line":"        # these tests."},{"line_number":94,"context_line":"        mock_conductor \u003d mock.patch.object("},{"line_number":95,"context_line":"            self.controller.compute_api, \u0027compute_task_api\u0027)"},{"line_number":96,"context_line":"        mock_conductor.start()"},{"line_number":97,"context_line":"        self.addCleanup(mock_conductor.stop)"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"    def _get_controller(self):"},{"line_number":100,"context_line":"        return self.servers.ServersController()"}],"source_content_type":"text/x-python","patch_set":4,"id":"9fdfeff1_0b70c3db","line":97,"range":{"start_line":86,"start_character":8,"end_line":97,"end_character":44},"in_reply_to":"9fdfeff1_eb59bf8d","updated":"2019-01-28 18:04:31.000000000","message":"Like this:\n\nhttps://review.openstack.org/#/c/630723/4/nova/tests/unit/api/openstack/compute/test_migrate_server.py@50","commit_id":"bbfb3bcf792b0d712ec59259479c8701b1e31722"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"6832126c211a3e748891c3c7b47f95682d1accdf","unresolved":false,"context_lines":[{"line_number":817,"context_line":"                          self.controller._action_resize,"},{"line_number":818,"context_line":"                          self.req, FAKE_UUID, body\u003dbody)"},{"line_number":819,"context_line":""},{"line_number":820,"context_line":"    @mock.patch(\u0027nova.api.openstack.common.\u0027"},{"line_number":821,"context_line":"                \u0027instance_has_port_with_resource_request\u0027, return_value\u003dFalse)"},{"line_number":822,"context_line":"    @mock.patch(\u0027nova.compute.api.API.resize\u0027,"},{"line_number":823,"context_line":"                side_effect\u003dexception.PciRequestAliasNotDefined("}],"source_content_type":"text/x-python","patch_set":4,"id":"9fdfeff1_cb6b9b1b","line":820,"updated":"2019-01-28 17:57:40.000000000","message":"Rather than have to slap this on all of the tests, I would suggest doing the mock in the test class setUp to just always return False. If a test case wanted to override that, it could reset the return_value.","commit_id":"bbfb3bcf792b0d712ec59259479c8701b1e31722"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"75bbeda453373ac4b17f33f24a5c9a4b7cfc7fc4","unresolved":false,"context_lines":[{"line_number":817,"context_line":"                          self.controller._action_resize,"},{"line_number":818,"context_line":"                          self.req, FAKE_UUID, body\u003dbody)"},{"line_number":819,"context_line":""},{"line_number":820,"context_line":"    @mock.patch(\u0027nova.api.openstack.common.\u0027"},{"line_number":821,"context_line":"                \u0027instance_has_port_with_resource_request\u0027, return_value\u003dFalse)"},{"line_number":822,"context_line":"    @mock.patch(\u0027nova.compute.api.API.resize\u0027,"},{"line_number":823,"context_line":"                side_effect\u003dexception.PciRequestAliasNotDefined("}],"source_content_type":"text/x-python","patch_set":4,"id":"9fdfeff1_24a9c88f","line":820,"in_reply_to":"9fdfeff1_04ce6381","updated":"2019-02-04 17:46:39.000000000","message":"Done","commit_id":"bbfb3bcf792b0d712ec59259479c8701b1e31722"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"c359eed953390309e9111266a7415ddb83925ddf","unresolved":false,"context_lines":[{"line_number":817,"context_line":"                          self.controller._action_resize,"},{"line_number":818,"context_line":"                          self.req, FAKE_UUID, body\u003dbody)"},{"line_number":819,"context_line":""},{"line_number":820,"context_line":"    @mock.patch(\u0027nova.api.openstack.common.\u0027"},{"line_number":821,"context_line":"                \u0027instance_has_port_with_resource_request\u0027, return_value\u003dFalse)"},{"line_number":822,"context_line":"    @mock.patch(\u0027nova.compute.api.API.resize\u0027,"},{"line_number":823,"context_line":"                side_effect\u003dexception.PciRequestAliasNotDefined("}],"source_content_type":"text/x-python","patch_set":4,"id":"9fdfeff1_f07afab7","line":820,"in_reply_to":"9fdfeff1_cb6b9b1b","updated":"2019-01-29 14:16:21.000000000","message":"+1","commit_id":"bbfb3bcf792b0d712ec59259479c8701b1e31722"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"caaf20d12ee4ffe8d8cf0357187b5be87b3de0da","unresolved":false,"context_lines":[{"line_number":817,"context_line":"                          self.controller._action_resize,"},{"line_number":818,"context_line":"                          self.req, FAKE_UUID, body\u003dbody)"},{"line_number":819,"context_line":""},{"line_number":820,"context_line":"    @mock.patch(\u0027nova.api.openstack.common.\u0027"},{"line_number":821,"context_line":"                \u0027instance_has_port_with_resource_request\u0027, return_value\u003dFalse)"},{"line_number":822,"context_line":"    @mock.patch(\u0027nova.compute.api.API.resize\u0027,"},{"line_number":823,"context_line":"                side_effect\u003dexception.PciRequestAliasNotDefined("}],"source_content_type":"text/x-python","patch_set":4,"id":"9fdfeff1_04ce6381","line":820,"in_reply_to":"9fdfeff1_cb6b9b1b","updated":"2019-01-30 15:34:00.000000000","message":"Yeah, make sense","commit_id":"bbfb3bcf792b0d712ec59259479c8701b1e31722"}]}
