)]}'
{"nova/api/openstack/compute/contrib/cloudpipe_update.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"a1ea604b53a16acc09012e1093c3078b2b0a1de6","unresolved":false,"context_lines":[{"line_number":52,"context_line":"        networks \u003d objects.NetworkList.get_by_project(context, project_id)"},{"line_number":53,"context_line":"        for network in networks:"},{"line_number":54,"context_line":"            network.vpn_public_address \u003d vpn_ip"},{"line_number":55,"context_line":"            network.vpn_public_port \u003d int(vpn_port)"},{"line_number":56,"context_line":"            network.save()"},{"line_number":57,"context_line":"        return webob.exc.HTTPAccepted()"},{"line_number":58,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"1ae5cdf2_59a7b450","line":55,"updated":"2014-06-23 17:32:55.000000000","message":"This integer conversion is implied now with the object, so you can remove it.","commit_id":"62b03fde689a514aed3d902ff7a64af507e07963"},{"author":{"_account_id":6167,"name":"Ken\u0027ichi Ohmichi","email":"ken1ohmichi@gmail.com","username":"oomichi"},"change_message_id":"438a42236c18985940630f70cec2e7851ce1f532","unresolved":false,"context_lines":[{"line_number":45,"context_line":"        try:"},{"line_number":46,"context_line":"            params \u003d body[\u0027configure_project\u0027]"},{"line_number":47,"context_line":"            vpn_ip \u003d params[\u0027vpn_ip\u0027]"},{"line_number":48,"context_line":"            vpn_port \u003d params[\u0027vpn_port\u0027]"},{"line_number":49,"context_line":"        except (TypeError, KeyError):"},{"line_number":50,"context_line":"            raise webob.exc.HTTPUnprocessableEntity()"},{"line_number":51,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"baada198_c57aeb76","line":48,"updated":"2014-07-16 08:47:57.000000000","message":"If passing chars like \"aaa\" as vpn_port TypeError happens at like 56 and current code does not catch it and and internal error will happen like this:\n\n $ curl -i \u0027http://192.168.11.62:8774/v2/b678e28fb3c14efa8675f2c5915da3b3/os-cloudpipe/configure-project\u0027 -X PUT .. -d \u0027{\"configure_project\": {\"vpn_ip\": \"192.168.10.200\", \"vpn_port\": \"abc\"}}\u0027\n\n [..]\n {\"computeFault\": {\"message\": \"The server has either erred or is incapable of performing the requested operation.\", \"code\": 500}}\n $\n\nThe log is\n\n   File \"/opt/stack/nova/nova/api/openstack/compute/contrib/cloudpipe_update.py\", line 55, in update\n     network.vpn_public_port \u003d vpn_port\n   File \"/opt/stack/nova/nova/objects/base.py\", line 72, in setter\n     field_value \u003d field.coerce(self, name, value)\n   File \"/opt/stack/nova/nova/objects/fields.py\", line 189, in coerce\n     return self._type.coerce(obj, attr, value)\n   File \"/opt/stack/nova/nova/objects/fields.py\", line 264, in coerce\n     return int(value)\n ValueError: invalid literal for int() with base 10: \u0027abc\u0027\n\nSo how about changing here to\n\n vpn_port \u003d int(params[\u0027vpn_port\u0027])\n\nfor avoiding internal error?","commit_id":"64cb1dc332ff932f1c700834d471b0c72da13365"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"3e8b1fdce42621ba3ae173d1a96751f410da7877","unresolved":false,"context_lines":[{"line_number":45,"context_line":"        try:"},{"line_number":46,"context_line":"            params \u003d body[\u0027configure_project\u0027]"},{"line_number":47,"context_line":"            vpn_ip \u003d params[\u0027vpn_ip\u0027]"},{"line_number":48,"context_line":"            vpn_port \u003d params[\u0027vpn_port\u0027]"},{"line_number":49,"context_line":"        except (TypeError, KeyError):"},{"line_number":50,"context_line":"            raise webob.exc.HTTPUnprocessableEntity()"},{"line_number":51,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"baada198_601bbb73","line":48,"in_reply_to":"baada198_c57aeb76","updated":"2014-07-16 14:59:16.000000000","message":"Actually, just setting the object attribute inside the try block will accomplish the same and be less code.\n\nGood catch though :)","commit_id":"64cb1dc332ff932f1c700834d471b0c72da13365"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"48c963329161af3dca5346907e1d52554722e19b","unresolved":false,"context_lines":[{"line_number":47,"context_line":"            vpn_ip \u003d params[\u0027vpn_ip\u0027]"},{"line_number":48,"context_line":"            vpn_port \u003d params[\u0027vpn_port\u0027]"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"            networks \u003d objects.NetworkList.get_by_project(context, project_id)"},{"line_number":51,"context_line":"            for network in networks:"},{"line_number":52,"context_line":"                network.vpn_public_address \u003d vpn_ip"},{"line_number":53,"context_line":"                network.vpn_public_port \u003d vpn_port"}],"source_content_type":"text/x-python","patch_set":3,"id":"baada198_41b4efd0","line":50,"updated":"2014-07-16 20:36:33.000000000","message":"I think this should technically be outside the try block, but this has been waiting long enough and it\u0027s not critical to change, IMHO.","commit_id":"9ec2e9e1a9e8599933790d9f0767b9e7e406941d"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"e2780295cacce0f426cb00b61644a67c8a81e4b2","unresolved":false,"context_lines":[{"line_number":47,"context_line":"            vpn_ip \u003d params[\u0027vpn_ip\u0027]"},{"line_number":48,"context_line":"            vpn_port \u003d params[\u0027vpn_port\u0027]"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"            networks \u003d objects.NetworkList.get_by_project(context, project_id)"},{"line_number":51,"context_line":"            for network in networks:"},{"line_number":52,"context_line":"                network.vpn_public_address \u003d vpn_ip"},{"line_number":53,"context_line":"                network.vpn_public_port \u003d vpn_port"}],"source_content_type":"text/x-python","patch_set":3,"id":"baada198_dc2aa42e","line":50,"in_reply_to":"baada198_41b4efd0","updated":"2014-07-16 21:03:39.000000000","message":"It\u0027s an easy change.","commit_id":"9ec2e9e1a9e8599933790d9f0767b9e7e406941d"}]}
