)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e46dad6da8854a78fda7a4ec7158b05b213b5cc6","unresolved":false,"context_lines":[{"line_number":11,"context_line":"used in all 3 nova api implementations to ensure a 400 response is"},{"line_number":12,"context_line":"returned just as neutron is returning to nova. While not strictly"},{"line_number":13,"context_line":"necessary in the v2.1 case since it would handle the unhandled"},{"line_number":14,"context_line":"exception correctly and ensure a 400 response this was added there"},{"line_number":15,"context_line":"too for consistency."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"Change-Id: I36e8ef0113ae91e3b15c846c6d10e0b766cf2a37"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"da20952f_ad689088","line":14,"updated":"2015-08-27 19:00:26.000000000","message":"nit: s/response/response,/\n\notherwise this last sentence was a bit hard to parse.\n\nLet me call up your 9th grade English teacher quick...","commit_id":"74e748687b03eeb3b47c0217d137007941ac98d0"},{"author":{"_account_id":5196,"name":"Matthew Treinish","email":"mtreinish@kortar.org","username":"treinish"},"change_message_id":"a41552f3a0e594c148346f4a39b9e542c6edac29","unresolved":false,"context_lines":[{"line_number":11,"context_line":"used in all 3 nova api implementations to ensure a 400 response is"},{"line_number":12,"context_line":"returned just as neutron is returning to nova. While not strictly"},{"line_number":13,"context_line":"necessary in the v2.1 case since it would handle the unhandled"},{"line_number":14,"context_line":"exception correctly and ensure a 400 response this was added there"},{"line_number":15,"context_line":"too for consistency."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"Change-Id: I36e8ef0113ae91e3b15c846c6d10e0b766cf2a37"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"da20952f_03270d65","line":14,"in_reply_to":"da20952f_ad689088","updated":"2015-08-27 20:12:24.000000000","message":"Actually this doesn\u0027t apply anymore, it\u0027s true on the floating ip attach, but not the create. My original rev was patching the wrong method.","commit_id":"74e748687b03eeb3b47c0217d137007941ac98d0"}],"nova/api/ec2/__init__.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c310c9e7a96194f84e513484f0f1503a93c11a50","unresolved":false,"context_lines":[{"line_number":634,"context_line":"                exception.SecurityGroupLimitExceeded,"},{"line_number":635,"context_line":"                exception.SecurityGroupRuleExists,"},{"line_number":636,"context_line":"                exception.VolumeUnattached,"},{"line_number":637,"context_line":"                exception.FloatingIpNoIPv4,"},{"line_number":638,"context_line":"                # Following aren\u0027t translated to valid EC2 errors."},{"line_number":639,"context_line":"                exception.ImageNotFound,"},{"line_number":640,"context_line":"                exception.ImageNotFoundEC2,"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a4dcd0f_6202beb6","line":637,"updated":"2015-08-08 13:29:22.000000000","message":"We should have a unit test for this to make sure it\u0027s not handled as an unexpected exception.","commit_id":"9c0edfd570e4ec31e2f09cbd7a0210ad12cfca80"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e46dad6da8854a78fda7a4ec7158b05b213b5cc6","unresolved":false,"context_lines":[{"line_number":614,"context_line":"            message \u003d ex.msg_fmt % {\u0027snapshot_id\u0027: ec2_id}"},{"line_number":615,"context_line":"            return ec2_error_ex(ex, req, message\u003dmessage)"},{"line_number":616,"context_line":"        except (exception.CannotDisassociateAutoAssignedFloatingIP,"},{"line_number":617,"context_line":"                exception.FloatingIpAssociated,"},{"line_number":618,"context_line":"                exception.FloatingIpNotFound,"},{"line_number":619,"context_line":"                exception.ImageNotActive,"},{"line_number":620,"context_line":"                exception.InvalidInstanceIDMalformed,"}],"source_content_type":"text/x-python","patch_set":3,"id":"da20952f_edf528cb","line":617,"updated":"2015-08-27 19:00:26.000000000","message":"nit: it\u0027d be nicer to group in the new thing here with the other FloatingIp* exceptions.","commit_id":"74e748687b03eeb3b47c0217d137007941ac98d0"},{"author":{"_account_id":5196,"name":"Matthew Treinish","email":"mtreinish@kortar.org","username":"treinish"},"change_message_id":"a41552f3a0e594c148346f4a39b9e542c6edac29","unresolved":false,"context_lines":[{"line_number":614,"context_line":"            message \u003d ex.msg_fmt % {\u0027snapshot_id\u0027: ec2_id}"},{"line_number":615,"context_line":"            return ec2_error_ex(ex, req, message\u003dmessage)"},{"line_number":616,"context_line":"        except (exception.CannotDisassociateAutoAssignedFloatingIP,"},{"line_number":617,"context_line":"                exception.FloatingIpAssociated,"},{"line_number":618,"context_line":"                exception.FloatingIpNotFound,"},{"line_number":619,"context_line":"                exception.ImageNotActive,"},{"line_number":620,"context_line":"                exception.InvalidInstanceIDMalformed,"}],"source_content_type":"text/x-python","patch_set":3,"id":"da20952f_c3a4b5a7","line":617,"in_reply_to":"da20952f_edf528cb","updated":"2015-08-27 20:12:24.000000000","message":"Done","commit_id":"74e748687b03eeb3b47c0217d137007941ac98d0"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9544121344eebf2ceeb91bee508a2ee2ccb77836","unresolved":false,"context_lines":[{"line_number":634,"context_line":"                exception.SecurityGroupLimitExceeded,"},{"line_number":635,"context_line":"                exception.SecurityGroupRuleExists,"},{"line_number":636,"context_line":"                exception.VolumeUnattached,"},{"line_number":637,"context_line":"                exception.FloatingIpBadRequest,"},{"line_number":638,"context_line":"                # Following aren\u0027t translated to valid EC2 errors."},{"line_number":639,"context_line":"                exception.ImageNotFound,"},{"line_number":640,"context_line":"                exception.ImageNotFoundEC2,"}],"source_content_type":"text/x-python","patch_set":3,"id":"da20952f_40897b25","line":637,"updated":"2015-08-27 19:14:17.000000000","message":"Can you test this case in here?\n\nhttp://git.openstack.org/cgit/openstack/nova/tree/nova/tests/unit/api/ec2/test_middleware.py#n92","commit_id":"74e748687b03eeb3b47c0217d137007941ac98d0"},{"author":{"_account_id":5196,"name":"Matthew Treinish","email":"mtreinish@kortar.org","username":"treinish"},"change_message_id":"a41552f3a0e594c148346f4a39b9e542c6edac29","unresolved":false,"context_lines":[{"line_number":634,"context_line":"                exception.SecurityGroupLimitExceeded,"},{"line_number":635,"context_line":"                exception.SecurityGroupRuleExists,"},{"line_number":636,"context_line":"                exception.VolumeUnattached,"},{"line_number":637,"context_line":"                exception.FloatingIpBadRequest,"},{"line_number":638,"context_line":"                # Following aren\u0027t translated to valid EC2 errors."},{"line_number":639,"context_line":"                exception.ImageNotFound,"},{"line_number":640,"context_line":"                exception.ImageNotFoundEC2,"}],"source_content_type":"text/x-python","patch_set":3,"id":"da20952f_83c55d3d","line":637,"in_reply_to":"da20952f_40897b25","updated":"2015-08-27 20:12:24.000000000","message":"Done","commit_id":"74e748687b03eeb3b47c0217d137007941ac98d0"}],"nova/api/openstack/compute/contrib/floating_ips.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c310c9e7a96194f84e513484f0f1503a93c11a50","unresolved":false,"context_lines":[{"line_number":128,"context_line":"            raise webob.exc.HTTPForbidden(explanation\u003dmsg)"},{"line_number":129,"context_line":"        except exception.FloatingIpPoolNotFound as e:"},{"line_number":130,"context_line":"            raise webob.exc.HTTPNotFound(explanation\u003de.format_message())"},{"line_number":131,"context_line":"        except exception.FloatingIpNoIPv4 as e:"},{"line_number":132,"context_line":"            raise webob.exc.HTTPBadRequest(explanation\u003de.format_message())"},{"line_number":133,"context_line":""},{"line_number":134,"context_line":"        return _translate_floating_ip_view(ip)"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a4dcd0f_e20d6ee9","line":131,"updated":"2015-08-08 13:29:22.000000000","message":"We need a unit test for this.","commit_id":"9c0edfd570e4ec31e2f09cbd7a0210ad12cfca80"},{"author":{"_account_id":5196,"name":"Matthew Treinish","email":"mtreinish@kortar.org","username":"treinish"},"change_message_id":"353eee7a40a9114613862c190e20d642bb54db32","unresolved":false,"context_lines":[{"line_number":128,"context_line":"            raise webob.exc.HTTPForbidden(explanation\u003dmsg)"},{"line_number":129,"context_line":"        except exception.FloatingIpPoolNotFound as e:"},{"line_number":130,"context_line":"            raise webob.exc.HTTPNotFound(explanation\u003de.format_message())"},{"line_number":131,"context_line":"        except exception.FloatingIpNoIPv4 as e:"},{"line_number":132,"context_line":"            raise webob.exc.HTTPBadRequest(explanation\u003de.format_message())"},{"line_number":133,"context_line":""},{"line_number":134,"context_line":"        return _translate_floating_ip_view(ip)"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a4dcd0f_2cdc2d72","line":131,"in_reply_to":"1a4dcd0f_e20d6ee9","updated":"2015-08-11 19:50:40.000000000","message":"Done","commit_id":"9c0edfd570e4ec31e2f09cbd7a0210ad12cfca80"}],"nova/api/openstack/compute/floating_ips.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e46dad6da8854a78fda7a4ec7158b05b213b5cc6","unresolved":false,"context_lines":[{"line_number":118,"context_line":""},{"line_number":119,"context_line":"        return _translate_floating_ips_view(floating_ips)"},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"    @extensions.expected_errors((400, 403, 404))"},{"line_number":122,"context_line":"    def create(self, req, body\u003dNone):"},{"line_number":123,"context_line":"        context \u003d req.environ[\u0027nova.context\u0027]"},{"line_number":124,"context_line":"        authorize(context)"}],"source_content_type":"text/x-python","patch_set":3,"id":"da20952f_ed9f684e","line":121,"updated":"2015-08-27 19:00:26.000000000","message":"ooo you\u0027re lucky we all agreed on this:\n\nhttps://review.openstack.org/#/c/217577/","commit_id":"74e748687b03eeb3b47c0217d137007941ac98d0"}],"nova/api/openstack/compute/plugins/v3/floating_ips.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c310c9e7a96194f84e513484f0f1503a93c11a50","unresolved":false,"context_lines":[{"line_number":245,"context_line":"            raise webob.exc.HTTPNotFound(explanation\u003dmsg)"},{"line_number":246,"context_line":"        except exception.Forbidden as e:"},{"line_number":247,"context_line":"            raise webob.exc.HTTPForbidden(explanation\u003de.format_message())"},{"line_number":248,"context_line":"        except exception.FloatingIpNoIPv4 as e:"},{"line_number":249,"context_line":"            raise webob.exc.HTTPBadRequest(explanation\u003de.format_message())"},{"line_number":250,"context_line":"        except Exception as e:"},{"line_number":251,"context_line":"            msg \u003d _(\u0027Unable to associate floating ip %(address)s to \u0027"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a4dcd0f_2204b6c4","line":248,"updated":"2015-08-08 13:29:22.000000000","message":"It\u0027d be good to have a unit test to make sure this is handled, although as the commit message says you\u0027ll get a 400 regardless.","commit_id":"9c0edfd570e4ec31e2f09cbd7a0210ad12cfca80"},{"author":{"_account_id":5196,"name":"Matthew Treinish","email":"mtreinish@kortar.org","username":"treinish"},"change_message_id":"353eee7a40a9114613862c190e20d642bb54db32","unresolved":false,"context_lines":[{"line_number":245,"context_line":"            raise webob.exc.HTTPNotFound(explanation\u003dmsg)"},{"line_number":246,"context_line":"        except exception.Forbidden as e:"},{"line_number":247,"context_line":"            raise webob.exc.HTTPForbidden(explanation\u003de.format_message())"},{"line_number":248,"context_line":"        except exception.FloatingIpNoIPv4 as e:"},{"line_number":249,"context_line":"            raise webob.exc.HTTPBadRequest(explanation\u003de.format_message())"},{"line_number":250,"context_line":"        except Exception as e:"},{"line_number":251,"context_line":"            msg \u003d _(\u0027Unable to associate floating ip %(address)s to \u0027"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a4dcd0f_0c74d165","line":248,"in_reply_to":"1a4dcd0f_2204b6c4","updated":"2015-08-11 19:50:40.000000000","message":"So this is handled in the same place as the v2 tests. I found this out because this is actually the wrong method for the catch. This is the associate not the create method.","commit_id":"9c0edfd570e4ec31e2f09cbd7a0210ad12cfca80"}],"nova/exception.py":[{"author":{"_account_id":6167,"name":"Ken\u0027ichi Ohmichi","email":"ken1ohmichi@gmail.com","username":"oomichi"},"change_message_id":"b2baad73408df1ac94aaee23ad50663b9a31a632","unresolved":false,"context_lines":[{"line_number":891,"context_line":"    msg_fmt \u003d _(\"Floating IP %(address)s association has failed.\")"},{"line_number":892,"context_line":""},{"line_number":893,"context_line":""},{"line_number":894,"context_line":"class FloatingIpNoIPv4(NovaException):"},{"line_number":895,"context_line":"    ec2_code \u003d \"UnsupportedOperation\""},{"line_number":896,"context_line":"    msg_fmt \u003d _(\"There is no IPv4 subnet available for a floating IP\")"},{"line_number":897,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"1a4dcd0f_a754c1c5","line":894,"updated":"2015-08-12 09:04:29.000000000","message":"To cover all BadRequest cases which come from Neutron side, how about FloatingIpBadReqeust(Invalid) instead ?","commit_id":"830b951904d8c6544bff685c2cabda9c39c8049f"},{"author":{"_account_id":5196,"name":"Matthew Treinish","email":"mtreinish@kortar.org","username":"treinish"},"change_message_id":"19606653f294dc2c304895a830bd10e30847f17e","unresolved":false,"context_lines":[{"line_number":891,"context_line":"    msg_fmt \u003d _(\"Floating IP %(address)s association has failed.\")"},{"line_number":892,"context_line":""},{"line_number":893,"context_line":""},{"line_number":894,"context_line":"class FloatingIpNoIPv4(NovaException):"},{"line_number":895,"context_line":"    ec2_code \u003d \"UnsupportedOperation\""},{"line_number":896,"context_line":"    msg_fmt \u003d _(\"There is no IPv4 subnet available for a floating IP\")"},{"line_number":897,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"da20952f_403d092a","line":894,"in_reply_to":"1a4dcd0f_a754c1c5","updated":"2015-08-27 15:10:35.000000000","message":"Done","commit_id":"830b951904d8c6544bff685c2cabda9c39c8049f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e46dad6da8854a78fda7a4ec7158b05b213b5cc6","unresolved":false,"context_lines":[{"line_number":900,"context_line":"    msg_fmt \u003d _(\"Floating IP %(address)s association has failed.\")"},{"line_number":901,"context_line":""},{"line_number":902,"context_line":""},{"line_number":903,"context_line":"class FloatingIpBadRequest(NovaException):"},{"line_number":904,"context_line":"    ec2_code \u003d \"UnsupportedOperation\""},{"line_number":905,"context_line":"    msg_fmt \u003d _(\"The floating IP request failed with a BadRequest\")"},{"line_number":906,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"da20952f_0de89cb3","line":903,"updated":"2015-08-27 19:00:26.000000000","message":"This should extend the Invalid type, not NovaException.  I think Ken\u0027ichi busted you on this in the last patch set.","commit_id":"74e748687b03eeb3b47c0217d137007941ac98d0"},{"author":{"_account_id":5196,"name":"Matthew Treinish","email":"mtreinish@kortar.org","username":"treinish"},"change_message_id":"a41552f3a0e594c148346f4a39b9e542c6edac29","unresolved":false,"context_lines":[{"line_number":900,"context_line":"    msg_fmt \u003d _(\"Floating IP %(address)s association has failed.\")"},{"line_number":901,"context_line":""},{"line_number":902,"context_line":""},{"line_number":903,"context_line":"class FloatingIpBadRequest(NovaException):"},{"line_number":904,"context_line":"    ec2_code \u003d \"UnsupportedOperation\""},{"line_number":905,"context_line":"    msg_fmt \u003d _(\"The floating IP request failed with a BadRequest\")"},{"line_number":906,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"da20952f_63cb691f","line":903,"in_reply_to":"da20952f_0de89cb3","updated":"2015-08-27 20:12:24.000000000","message":"Done","commit_id":"74e748687b03eeb3b47c0217d137007941ac98d0"}],"nova/network/neutronv2/api.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c310c9e7a96194f84e513484f0f1503a93c11a50","unresolved":false,"context_lines":[{"line_number":1396,"context_line":"        except neutron_client_exc.OverQuotaClient as e:"},{"line_number":1397,"context_line":"            raise exception.FloatingIpLimitExceeded(six.text_type(e))"},{"line_number":1398,"context_line":"        except neutron_client_exc.BadRequest as e:"},{"line_number":1399,"context_line":"            if \u0027does not contain any IPv4 subnet\u0027 in e.message:"},{"line_number":1400,"context_line":"                raise exception.FloatingIpNoIPv4(six.text_type(e))"},{"line_number":1401,"context_line":"            else:"},{"line_number":1402,"context_line":"                raise"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a4dcd0f_82510adb","line":1399,"updated":"2015-08-08 13:29:22.000000000","message":"eww, can we add a TODO to do this translation to a specific exception from neutronclient so that nova can handle that rather than parse the message?\n\nAlso, Exception.message is deprecated so we should probably use six.text_type(e) to parse the error message.","commit_id":"9c0edfd570e4ec31e2f09cbd7a0210ad12cfca80"},{"author":{"_account_id":5196,"name":"Matthew Treinish","email":"mtreinish@kortar.org","username":"treinish"},"change_message_id":"75750765f5ebc768a8e9e8900d87690dad02ca06","unresolved":false,"context_lines":[{"line_number":1396,"context_line":"        except neutron_client_exc.OverQuotaClient as e:"},{"line_number":1397,"context_line":"            raise exception.FloatingIpLimitExceeded(six.text_type(e))"},{"line_number":1398,"context_line":"        except neutron_client_exc.BadRequest as e:"},{"line_number":1399,"context_line":"            if \u0027does not contain any IPv4 subnet\u0027 in e.message:"},{"line_number":1400,"context_line":"                raise exception.FloatingIpNoIPv4(six.text_type(e))"},{"line_number":1401,"context_line":"            else:"},{"line_number":1402,"context_line":"                raise"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a4dcd0f_93bfd5fb","line":1399,"in_reply_to":"1a4dcd0f_793a3536","updated":"2015-08-11 01:52:46.000000000","message":"Well it\u0027ll still blow up with a 500 on ec2 in that case, but frankly I don\u0027t care about ec2, so I\u0027ll defer to you guys with which approach to take. Either just catch a neutron_client_exc.BadRequest in:\n\nnova/api/openstack/compute/contrib/floating_ips.py\n\nor converting it here to something nova specific and catching that in the api layers. (I\u0027ll work on making this a specific neutronclient exception too) As for the fragility, yeah neutron could change that message I guess (although that\u0027s something we could enforce on them without telling them with a tempest test or something) \n\nEither way I\u0027d like a definitive path forward here, so just tell me exactly which way to do it and I\u0027ll go off and implement it tomorrow.","commit_id":"9c0edfd570e4ec31e2f09cbd7a0210ad12cfca80"},{"author":{"_account_id":6167,"name":"Ken\u0027ichi Ohmichi","email":"ken1ohmichi@gmail.com","username":"oomichi"},"change_message_id":"04e35786512564b426641abb703e365687b372d5","unresolved":false,"context_lines":[{"line_number":1396,"context_line":"        except neutron_client_exc.OverQuotaClient as e:"},{"line_number":1397,"context_line":"            raise exception.FloatingIpLimitExceeded(six.text_type(e))"},{"line_number":1398,"context_line":"        except neutron_client_exc.BadRequest as e:"},{"line_number":1399,"context_line":"            if \u0027does not contain any IPv4 subnet\u0027 in e.message:"},{"line_number":1400,"context_line":"                raise exception.FloatingIpNoIPv4(six.text_type(e))"},{"line_number":1401,"context_line":"            else:"},{"line_number":1402,"context_line":"                raise"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a4dcd0f_e1123958","line":1399,"in_reply_to":"1a4dcd0f_82510adb","updated":"2015-08-10 03:52:03.000000000","message":"I don\u0027t prefer this way which depends on \"error message\" from the other project. This  seems fragile.\n\nWhy don\u0027t you just catch neutron_client_exc.BadRequest without digging the message?\nI did the similar fix for security group on https://review.openstack.org/#/c/189541","commit_id":"9c0edfd570e4ec31e2f09cbd7a0210ad12cfca80"},{"author":{"_account_id":10234,"name":"Andrey Pavlov","email":"andrey.mp@gmail.com","username":"andrey-mp"},"change_message_id":"985595aba5c7a2bc176cdc76dd9281dc12525ca0","unresolved":false,"context_lines":[{"line_number":1396,"context_line":"        except neutron_client_exc.OverQuotaClient as e:"},{"line_number":1397,"context_line":"            raise exception.FloatingIpLimitExceeded(six.text_type(e))"},{"line_number":1398,"context_line":"        except neutron_client_exc.BadRequest as e:"},{"line_number":1399,"context_line":"            if \u0027does not contain any IPv4 subnet\u0027 in e.message:"},{"line_number":1400,"context_line":"                raise exception.FloatingIpNoIPv4(six.text_type(e))"},{"line_number":1401,"context_line":"            else:"},{"line_number":1402,"context_line":"                raise"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a4dcd0f_09f03e90","line":1399,"in_reply_to":"1a4dcd0f_91279ab5","updated":"2015-08-11 21:06:27.000000000","message":"In \u0027else\u0027 block behavior didn\u0027t changed - ec2  returns 500 in this case.\nIn \u0027if\u0027 block known exception is raised (known for catcher in __init__.py) - ec2 returns 400.\n\nSo it is a good change for nova\u0027s ec2.\nAlso we will check handling of this case in standalone ec2 project.","commit_id":"9c0edfd570e4ec31e2f09cbd7a0210ad12cfca80"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"6184128e6f5bf56a3d6a2ad30b7e2f4b1e7442b0","unresolved":false,"context_lines":[{"line_number":1396,"context_line":"        except neutron_client_exc.OverQuotaClient as e:"},{"line_number":1397,"context_line":"            raise exception.FloatingIpLimitExceeded(six.text_type(e))"},{"line_number":1398,"context_line":"        except neutron_client_exc.BadRequest as e:"},{"line_number":1399,"context_line":"            if \u0027does not contain any IPv4 subnet\u0027 in e.message:"},{"line_number":1400,"context_line":"                raise exception.FloatingIpNoIPv4(six.text_type(e))"},{"line_number":1401,"context_line":"            else:"},{"line_number":1402,"context_line":"                raise"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a4dcd0f_91279ab5","line":1399,"in_reply_to":"1a4dcd0f_93bfd5fb","updated":"2015-08-11 18:48:05.000000000","message":"Hrm, I\u0027m inclined to care about the ec2 API in this case and lean toward fixing it this way so that ec2 is also handling it w/o a 500.\n\nneutronclient already does a pretty solid job of translating exceptions to specific types that nova can then use, I\u0027ve done a few of those in the past myself and we use them liberally here in the neutron v2 API, so I don\u0027t worry too much about that changing.","commit_id":"9c0edfd570e4ec31e2f09cbd7a0210ad12cfca80"},{"author":{"_account_id":10224,"name":"Feodor Tersin","email":"ftersin@hotmail.com","username":"ftersin"},"change_message_id":"72914f340bd1a6ccd76fc6a5a78cfe72313b9279","unresolved":false,"context_lines":[{"line_number":1396,"context_line":"        except neutron_client_exc.OverQuotaClient as e:"},{"line_number":1397,"context_line":"            raise exception.FloatingIpLimitExceeded(six.text_type(e))"},{"line_number":1398,"context_line":"        except neutron_client_exc.BadRequest as e:"},{"line_number":1399,"context_line":"            if \u0027does not contain any IPv4 subnet\u0027 in e.message:"},{"line_number":1400,"context_line":"                raise exception.FloatingIpNoIPv4(six.text_type(e))"},{"line_number":1401,"context_line":"            else:"},{"line_number":1402,"context_line":"                raise"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a4dcd0f_d8b77583","line":1399,"in_reply_to":"1a4dcd0f_93bfd5fb","updated":"2015-08-12 04:31:37.000000000","message":"ec2 returns 400 for an exception if it\u0027s contained in an expected exception set (when you\u0027ve placed your new exception), or if it has code\u003d400 member.\n\nBoth cases are processed by ec2_error_ex (https://github.com/openstack/nova/blob/master/nova/api/ec2/__init__.py#L645). The difference is that for unexpected exceptions It writes error to log (instead of warning) and some parts of environment as well.\n\nSince Invalid exception has code\u003d400, if you raise it here, ec2 will expose 400:\n\n from nova.api import ec2\n from nova import exception\n import mock\n\n e \u003d exception.Invalid(\u0027fake msg\u0027)\n req \u003d mock.NonCallableMagicMock()\n req.environ[\u0027nova_context\u0027].request_id \u003d \u0027fake\u0027\n fault \u003d ec2.ec2_error_ex(e, req, unexpected\u003dTrue)\n print fault.status\n print fault.body\n\n400 Bad Request\n\u003c?xml version\u003d\"1.0\"?\u003e\n\u003cResponse\u003e\u003cErrors\u003e\u003cError\u003e\u003cCode\u003eInvalid\u003c/Code\u003e\u003cMessage\u003efake msg\u003c/Message\u003e\u003c/Error\u003e\u003c/Errors\u003e\u003cRequestID\u003efake\u003c/RequestID\u003e\u003c/Response\u003e\n\nSo if you don\u0027t like to add a new exception and don\u0027t care about log, you can raise Invalid or any other one with code\u003d400.\n\nOther option is to use NoFloatingIpInterface with custom message. It also exposes AWS-compatible error code: UnsupportedOperation.","commit_id":"9c0edfd570e4ec31e2f09cbd7a0210ad12cfca80"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"beb08da675773fffc818752465b73589f9b38fb4","unresolved":false,"context_lines":[{"line_number":1396,"context_line":"        except neutron_client_exc.OverQuotaClient as e:"},{"line_number":1397,"context_line":"            raise exception.FloatingIpLimitExceeded(six.text_type(e))"},{"line_number":1398,"context_line":"        except neutron_client_exc.BadRequest as e:"},{"line_number":1399,"context_line":"            if \u0027does not contain any IPv4 subnet\u0027 in e.message:"},{"line_number":1400,"context_line":"                raise exception.FloatingIpNoIPv4(six.text_type(e))"},{"line_number":1401,"context_line":"            else:"},{"line_number":1402,"context_line":"                raise"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a4dcd0f_793a3536","line":1399,"in_reply_to":"1a4dcd0f_e1123958","updated":"2015-08-10 19:41:42.000000000","message":"Yeah, could do that too.  Then we wouldn\u0027t need the new exception type.  We\u0027d still need the compute API changes to handle it (at least in v2), but then we wouldn\u0027t need this error parsing.","commit_id":"9c0edfd570e4ec31e2f09cbd7a0210ad12cfca80"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c310c9e7a96194f84e513484f0f1503a93c11a50","unresolved":false,"context_lines":[{"line_number":1397,"context_line":"            raise exception.FloatingIpLimitExceeded(six.text_type(e))"},{"line_number":1398,"context_line":"        except neutron_client_exc.BadRequest as e:"},{"line_number":1399,"context_line":"            if \u0027does not contain any IPv4 subnet\u0027 in e.message:"},{"line_number":1400,"context_line":"                raise exception.FloatingIpNoIPv4(six.text_type(e))"},{"line_number":1401,"context_line":"            else:"},{"line_number":1402,"context_line":"                raise"},{"line_number":1403,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"1a4dcd0f_426222af","line":1400,"updated":"2015-08-08 13:29:22.000000000","message":"We need a unit test to make sure this is correctly parsed and handled.","commit_id":"9c0edfd570e4ec31e2f09cbd7a0210ad12cfca80"},{"author":{"_account_id":5196,"name":"Matthew Treinish","email":"mtreinish@kortar.org","username":"treinish"},"change_message_id":"353eee7a40a9114613862c190e20d642bb54db32","unresolved":false,"context_lines":[{"line_number":1397,"context_line":"            raise exception.FloatingIpLimitExceeded(six.text_type(e))"},{"line_number":1398,"context_line":"        except neutron_client_exc.BadRequest as e:"},{"line_number":1399,"context_line":"            if \u0027does not contain any IPv4 subnet\u0027 in e.message:"},{"line_number":1400,"context_line":"                raise exception.FloatingIpNoIPv4(six.text_type(e))"},{"line_number":1401,"context_line":"            else:"},{"line_number":1402,"context_line":"                raise"},{"line_number":1403,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"1a4dcd0f_b13736fe","line":1400,"in_reply_to":"1a4dcd0f_426222af","updated":"2015-08-11 19:50:40.000000000","message":"Done","commit_id":"9c0edfd570e4ec31e2f09cbd7a0210ad12cfca80"},{"author":{"_account_id":6167,"name":"Ken\u0027ichi Ohmichi","email":"ken1ohmichi@gmail.com","username":"oomichi"},"change_message_id":"b2baad73408df1ac94aaee23ad50663b9a31a632","unresolved":false,"context_lines":[{"line_number":1398,"context_line":"        except neutron_client_exc.BadRequest as e:"},{"line_number":1399,"context_line":"            # TODO(mriedem): Add a specific neutronclient exception for no ipv4"},{"line_number":1400,"context_line":"            # subnet available"},{"line_number":1401,"context_line":"            if \u0027does not contain any IPv4 subnet\u0027 in e.message:"},{"line_number":1402,"context_line":"                raise exception.FloatingIpNoIPv4(six.text_type(e))"},{"line_number":1403,"context_line":"            else:"},{"line_number":1404,"context_line":"                raise"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a4dcd0f_0c66fa50","line":1401,"updated":"2015-08-12 09:04:29.000000000","message":"It is fine to change here like:\n\n except neutron_client_exc.BadRequest as e:\n     raise exception.FloatingIpBadReqeust(six.text_type(e))","commit_id":"830b951904d8c6544bff685c2cabda9c39c8049f"},{"author":{"_account_id":5196,"name":"Matthew Treinish","email":"mtreinish@kortar.org","username":"treinish"},"change_message_id":"19606653f294dc2c304895a830bd10e30847f17e","unresolved":false,"context_lines":[{"line_number":1398,"context_line":"        except neutron_client_exc.BadRequest as e:"},{"line_number":1399,"context_line":"            # TODO(mriedem): Add a specific neutronclient exception for no ipv4"},{"line_number":1400,"context_line":"            # subnet available"},{"line_number":1401,"context_line":"            if \u0027does not contain any IPv4 subnet\u0027 in e.message:"},{"line_number":1402,"context_line":"                raise exception.FloatingIpNoIPv4(six.text_type(e))"},{"line_number":1403,"context_line":"            else:"},{"line_number":1404,"context_line":"                raise"}],"source_content_type":"text/x-python","patch_set":2,"id":"da20952f_406bc91e","line":1401,"in_reply_to":"1a4dcd0f_0c66fa50","updated":"2015-08-27 15:10:35.000000000","message":"Done","commit_id":"830b951904d8c6544bff685c2cabda9c39c8049f"}],"nova/tests/unit/api/openstack/compute/test_floating_ips.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e46dad6da8854a78fda7a4ec7158b05b213b5cc6","unresolved":false,"context_lines":[{"line_number":434,"context_line":"                \u0027Bad floatingip request: Network \u0027"},{"line_number":435,"context_line":"                \u0027c8f0e88f-ae41-47cb-be6c-d8256ba80576 does not contain any \u0027"},{"line_number":436,"context_line":"                \u0027IPv4 subnet\u0027)"},{"line_number":437,"context_line":"        self.stubs.Set(network.api.API, \"allocate_floating_ip\", fake_allocate)"},{"line_number":438,"context_line":""},{"line_number":439,"context_line":"        ex \u003d self.assertRaises(webob.exc.HTTPBadRequest,"},{"line_number":440,"context_line":"                               self.controller.create, self.fake_req,"}],"source_content_type":"text/x-python","patch_set":3,"id":"da20952f_adf8904a","line":437,"updated":"2015-08-27 19:00:26.000000000","message":"Please use mock for new unit tests, should be easy enough to decorate this method with:\n\n@mock.patch.object(network.api.API, \u0027allocate_floating_ip\u0027, side_effect\u003dexception.FloatingIpBadRequest(...))","commit_id":"74e748687b03eeb3b47c0217d137007941ac98d0"},{"author":{"_account_id":5196,"name":"Matthew Treinish","email":"mtreinish@kortar.org","username":"treinish"},"change_message_id":"a41552f3a0e594c148346f4a39b9e542c6edac29","unresolved":false,"context_lines":[{"line_number":434,"context_line":"                \u0027Bad floatingip request: Network \u0027"},{"line_number":435,"context_line":"                \u0027c8f0e88f-ae41-47cb-be6c-d8256ba80576 does not contain any \u0027"},{"line_number":436,"context_line":"                \u0027IPv4 subnet\u0027)"},{"line_number":437,"context_line":"        self.stubs.Set(network.api.API, \"allocate_floating_ip\", fake_allocate)"},{"line_number":438,"context_line":""},{"line_number":439,"context_line":"        ex \u003d self.assertRaises(webob.exc.HTTPBadRequest,"},{"line_number":440,"context_line":"                               self.controller.create, self.fake_req,"}],"source_content_type":"text/x-python","patch_set":3,"id":"da20952f_e308d92f","line":437,"in_reply_to":"da20952f_adf8904a","updated":"2015-08-27 20:12:24.000000000","message":"Done","commit_id":"74e748687b03eeb3b47c0217d137007941ac98d0"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e46dad6da8854a78fda7a4ec7158b05b213b5cc6","unresolved":false,"context_lines":[{"line_number":440,"context_line":"                               self.controller.create, self.fake_req,"},{"line_number":441,"context_line":"                               {\u0027pool\u0027: \u0027non_existent_pool\u0027})"},{"line_number":442,"context_line":"        self.assertIn(\"does not contain any IPv4 subnet\","},{"line_number":443,"context_line":"                      ex.explanation)"},{"line_number":444,"context_line":""},{"line_number":445,"context_line":"    @mock.patch(\u0027nova.network.api.API.allocate_floating_ip\u0027,"},{"line_number":446,"context_line":"                side_effect\u003dexception.FloatingIpLimitExceeded())"}],"source_content_type":"text/x-python","patch_set":3,"id":"da20952f_0da09c42","line":443,"updated":"2015-08-27 19:00:26.000000000","message":"Probably better to use six.text_type(ex) here.","commit_id":"74e748687b03eeb3b47c0217d137007941ac98d0"},{"author":{"_account_id":5196,"name":"Matthew Treinish","email":"mtreinish@kortar.org","username":"treinish"},"change_message_id":"a41552f3a0e594c148346f4a39b9e542c6edac29","unresolved":false,"context_lines":[{"line_number":440,"context_line":"                               self.controller.create, self.fake_req,"},{"line_number":441,"context_line":"                               {\u0027pool\u0027: \u0027non_existent_pool\u0027})"},{"line_number":442,"context_line":"        self.assertIn(\"does not contain any IPv4 subnet\","},{"line_number":443,"context_line":"                      ex.explanation)"},{"line_number":444,"context_line":""},{"line_number":445,"context_line":"    @mock.patch(\u0027nova.network.api.API.allocate_floating_ip\u0027,"},{"line_number":446,"context_line":"                side_effect\u003dexception.FloatingIpLimitExceeded())"}],"source_content_type":"text/x-python","patch_set":3,"id":"da20952f_5e007c01","line":443,"in_reply_to":"da20952f_0da09c42","updated":"2015-08-27 20:12:24.000000000","message":"Done","commit_id":"74e748687b03eeb3b47c0217d137007941ac98d0"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7f782e77b8ca04dba5f5c28904441512444462c1","unresolved":false,"context_lines":[{"line_number":439,"context_line":"                               self.controller.create, self.fake_req,"},{"line_number":440,"context_line":"                               {\u0027pool\u0027: \u0027non_existent_pool\u0027})"},{"line_number":441,"context_line":"        self.assertIn(\"does not contain any IPv4 subnet\","},{"line_number":442,"context_line":"                      six.text_type(ex.explanation))"},{"line_number":443,"context_line":""},{"line_number":444,"context_line":"    @mock.patch(\u0027nova.network.api.API.allocate_floating_ip\u0027,"},{"line_number":445,"context_line":"                side_effect\u003dexception.FloatingIpLimitExceeded())"}],"source_content_type":"text/x-python","patch_set":5,"id":"da20952f_23c5683b","line":442,"updated":"2015-08-27 23:16:22.000000000","message":"You don\u0027t need ex.eplanation, six.text_type(ex) should give us what we want.","commit_id":"8cf9f795a60bc817ce03a2f932003432dee7ebab"},{"author":{"_account_id":5196,"name":"Matthew Treinish","email":"mtreinish@kortar.org","username":"treinish"},"change_message_id":"db45a1e9391f9d401417de66b3fe0f09d0b59a06","unresolved":false,"context_lines":[{"line_number":439,"context_line":"                               self.controller.create, self.fake_req,"},{"line_number":440,"context_line":"                               {\u0027pool\u0027: \u0027non_existent_pool\u0027})"},{"line_number":441,"context_line":"        self.assertIn(\"does not contain any IPv4 subnet\","},{"line_number":442,"context_line":"                      six.text_type(ex.explanation))"},{"line_number":443,"context_line":""},{"line_number":444,"context_line":"    @mock.patch(\u0027nova.network.api.API.allocate_floating_ip\u0027,"},{"line_number":445,"context_line":"                side_effect\u003dexception.FloatingIpLimitExceeded())"}],"source_content_type":"text/x-python","patch_set":5,"id":"da20952f_83ac7436","line":442,"in_reply_to":"da20952f_23c5683b","updated":"2015-08-27 23:30:08.000000000","message":"Done","commit_id":"8cf9f795a60bc817ce03a2f932003432dee7ebab"}],"nova/tests/unit/network/test_neutronv2.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e46dad6da8854a78fda7a4ec7158b05b213b5cc6","unresolved":false,"context_lines":[{"line_number":2103,"context_line":"        self.assertRaises(exception.NoMoreFloatingIps,"},{"line_number":2104,"context_line":"                          api.allocate_floating_ip, self.context, \u0027ext_net\u0027)"},{"line_number":2105,"context_line":""},{"line_number":2106,"context_line":"    def test_allocate_floating_ip_no_ipv4_subnet(self):"},{"line_number":2107,"context_line":"        api \u003d neutronapi.API()"},{"line_number":2108,"context_line":"        pool_name \u003d self.fip_pool[\u0027name\u0027]"},{"line_number":2109,"context_line":"        pool_id \u003d self.fip_pool[\u0027id\u0027]"}],"source_content_type":"text/x-python","patch_set":3,"id":"da20952f_6d3598f5","line":2106,"updated":"2015-08-27 19:00:26.000000000","message":"Could we actually do this in TestNeutronv2WithMock and use mock?  Most of us really hate the mega mox stubbing done in setUp of this test class and how brittle it makes most of the tests - would be much nicer to add new tests using mock in TestNeutronv2WithMock.  Pretty please...","commit_id":"74e748687b03eeb3b47c0217d137007941ac98d0"},{"author":{"_account_id":5196,"name":"Matthew Treinish","email":"mtreinish@kortar.org","username":"treinish"},"change_message_id":"a41552f3a0e594c148346f4a39b9e542c6edac29","unresolved":false,"context_lines":[{"line_number":2103,"context_line":"        self.assertRaises(exception.NoMoreFloatingIps,"},{"line_number":2104,"context_line":"                          api.allocate_floating_ip, self.context, \u0027ext_net\u0027)"},{"line_number":2105,"context_line":""},{"line_number":2106,"context_line":"    def test_allocate_floating_ip_no_ipv4_subnet(self):"},{"line_number":2107,"context_line":"        api \u003d neutronapi.API()"},{"line_number":2108,"context_line":"        pool_name \u003d self.fip_pool[\u0027name\u0027]"},{"line_number":2109,"context_line":"        pool_id \u003d self.fip_pool[\u0027id\u0027]"}],"source_content_type":"text/x-python","patch_set":3,"id":"da20952f_be5e7810","line":2106,"in_reply_to":"da20952f_6d3598f5","updated":"2015-08-27 20:12:24.000000000","message":"Done","commit_id":"74e748687b03eeb3b47c0217d137007941ac98d0"}]}
