)]}'
{"bin/nova-manage":[{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"a265b707bf67e75587a35be0a9a6cec246242dea","unresolved":false,"context_lines":[{"line_number":295,"context_line":"                fixed_ips \u003d db.fixed_ip_get_all(ctxt)"},{"line_number":296,"context_line":"            else:"},{"line_number":297,"context_line":"                fixed_ips \u003d []"},{"line_number":298,"context_line":"                instances \u003d db.instance_get_all_by_host(ctxt, host)"},{"line_number":299,"context_line":"                for instance in instances:"},{"line_number":300,"context_line":"                    for fixed in db.fixed_ip_get_by_instance(ctxt,"},{"line_number":301,"context_line":"                                                             instance[\u0027uuid\u0027]):"}],"source_content_type":"application/octet-stream","patch_set":2,"id":"AAAAOX%2F%2F%2FqQ%3D","line":298,"updated":"2013-04-03 08:09:57.000000000","message":"This approach has terrible performance, \nI think that it is better to add new method in db.api that do something like: \n\n1) get all instances uuids by host (1 query)\n2) get all fixed ip where FixedIp.instance_uuid in this uuids (1 query)\n\nInstead of doing instance_get_all_by_host that returns all instances on host with joined info_cache, security_groups, metadata and system_metadata. And then N queries for each instance uuid to get fixed_ip..","commit_id":"555f1c6adb73333c996e5f1d2a58b2ddbf29a58d"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"4c1f8d2061a22d192f4db0506d2564523e9bb114","unresolved":false,"context_lines":[{"line_number":16,"context_line":"# See the License for the specific language governing permissions and"},{"line_number":17,"context_line":"# limitations under the License."},{"line_number":18,"context_line":""},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"# Temporary shim to do a devstack transition"},{"line_number":21,"context_line":"from nova.cmd import manage"},{"line_number":22,"context_line":""}],"source_content_type":"application/octet-stream","patch_set":7,"id":"AAAAOn%2F%2F%2FXY%3D","side":"PARENT","line":19,"updated":"2013-04-08 23:27:00.000000000","message":"Random whitespace change?","commit_id":"24582abf82842cbb922e38c78e281eda56f981e2"},{"author":{"_account_id":2271,"name":"Michael Still","email":"mikal@stillhq.com","username":"mikalstill"},"change_message_id":"810975c367d85ac49a4cfc7b3ecb5f87ea601466","unresolved":false,"context_lines":[{"line_number":16,"context_line":"# See the License for the specific language governing permissions and"},{"line_number":17,"context_line":"# limitations under the License."},{"line_number":18,"context_line":""},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"# Temporary shim to do a devstack transition"},{"line_number":21,"context_line":"from nova.cmd import manage"},{"line_number":22,"context_line":""}],"source_content_type":"application/octet-stream","patch_set":7,"id":"AAAAOn%2F%2F9ak%3D","side":"PARENT","line":19,"in_reply_to":"AAAAOn%2F%2F%2FXY%3D","updated":"2013-04-10 04:39:16.000000000","message":"Done","commit_id":"24582abf82842cbb922e38c78e281eda56f981e2"}],"nova/cmd/manage.py":[{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"750f1c3710be69490b532e3d193f921c73f201e7","unresolved":false,"context_lines":[{"line_number":285,"context_line":"            if host is None:"},{"line_number":286,"context_line":"                fixed_ips \u003d db.fixed_ip_get_all(ctxt)"},{"line_number":287,"context_line":"            else:"},{"line_number":288,"context_line":"                fixed_ips \u003d fixed_ips \u003d db.fixed_ip_get_by_host(ctxt, host)"},{"line_number":289,"context_line":""},{"line_number":290,"context_line":"        except exception.NotFound as ex:"},{"line_number":291,"context_line":"            print _(\"error: %s\") % ex"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAOX%2F%2F8AQ%3D","line":288,"updated":"2013-04-05 07:19:15.000000000","message":"hmm fixed_ips \u003d fixed_ips \u003d ...?","commit_id":"4a8a1a0b8f4fd2ee7cea71999d60bd73f0df8f41"},{"author":{"_account_id":2271,"name":"Michael Still","email":"mikal@stillhq.com","username":"mikalstill"},"change_message_id":"9c82ebfe105f2b998013937d0e01aaf62e8f0e67","unresolved":false,"context_lines":[{"line_number":285,"context_line":"            if host is None:"},{"line_number":286,"context_line":"                fixed_ips \u003d db.fixed_ip_get_all(ctxt)"},{"line_number":287,"context_line":"            else:"},{"line_number":288,"context_line":"                fixed_ips \u003d fixed_ips \u003d db.fixed_ip_get_by_host(ctxt, host)"},{"line_number":289,"context_line":""},{"line_number":290,"context_line":"        except exception.NotFound as ex:"},{"line_number":291,"context_line":"            print _(\"error: %s\") % ex"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAOX%2F%2F7AM%3D","line":288,"in_reply_to":"AAAAOX%2F%2F8AQ%3D","updated":"2013-04-05 21:48:47.000000000","message":"Oh, paste error. Thanks for spotting this.","commit_id":"4a8a1a0b8f4fd2ee7cea71999d60bd73f0df8f41"}],"nova/db/api.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"4c1f8d2061a22d192f4db0506d2564523e9bb114","unresolved":false,"context_lines":[{"line_number":632,"context_line":"    return IMPL.instance_get_all_by_host(context, host)"},{"line_number":633,"context_line":""},{"line_number":634,"context_line":""},{"line_number":635,"context_line":"def instance_get_all_uuids_by_host(context, host):"},{"line_number":636,"context_line":"    \"\"\"Get all instances belonging to a host, without joins.\"\"\""},{"line_number":637,"context_line":"    return IMPL.instance_get_all_uuids_by_host(context, host)"},{"line_number":638,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAOn%2F%2F%2FXk%3D","line":635,"updated":"2013-04-08 23:27:00.000000000","message":"I don\u0027t see where this is used...","commit_id":"9a496821c56fcf05f67dee02d16b28baa05dc554"},{"author":{"_account_id":2271,"name":"Michael Still","email":"mikal@stillhq.com","username":"mikalstill"},"change_message_id":"810975c367d85ac49a4cfc7b3ecb5f87ea601466","unresolved":false,"context_lines":[{"line_number":632,"context_line":"    return IMPL.instance_get_all_by_host(context, host)"},{"line_number":633,"context_line":""},{"line_number":634,"context_line":""},{"line_number":635,"context_line":"def instance_get_all_uuids_by_host(context, host):"},{"line_number":636,"context_line":"    \"\"\"Get all instances belonging to a host, without joins.\"\"\""},{"line_number":637,"context_line":"    return IMPL.instance_get_all_uuids_by_host(context, host)"},{"line_number":638,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAOn%2F%2F9ag%3D","line":635,"in_reply_to":"AAAAOn%2F%2F%2FXk%3D","updated":"2013-04-10 04:39:16.000000000","message":"Given I\u0027d added the support for it (the internal version is used by this new code) I figured it was worth the extra effort to expose the functionality to other users.","commit_id":"9a496821c56fcf05f67dee02d16b28baa05dc554"}],"nova/db/sqlalchemy/api.py":[{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"0fc07db45efe75a9ff1472d2d92eb7eff21014c0","unresolved":false,"context_lines":[{"line_number":1225,"context_line":"    return result"},{"line_number":1226,"context_line":""},{"line_number":1227,"context_line":""},{"line_number":1228,"context_line":"@require_context"},{"line_number":1229,"context_line":"def fixed_ip_get_by_host(context, host):"},{"line_number":1230,"context_line":"    fixed_ips \u003d []"},{"line_number":1231,"context_line":"    for instance in instance_get_all_by_host_light(context, host):"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAOX%2F%2F%2FeE%3D","line":1228,"updated":"2013-04-03 11:34:11.000000000","message":"why is this only require_context, as it calls a method that is require_admin_context? probably should be consistent?\n\nShould we not have tests for these new db apis?","commit_id":"ae8cbc3a290f122f3f4dcbbbb5c84e80be2dd27f"},{"author":{"_account_id":2271,"name":"Michael Still","email":"mikal@stillhq.com","username":"mikalstill"},"change_message_id":"1f86fa865f2aa85d6c625d944687ccf790862b1f","unresolved":false,"context_lines":[{"line_number":1225,"context_line":"    return result"},{"line_number":1226,"context_line":""},{"line_number":1227,"context_line":""},{"line_number":1228,"context_line":"@require_context"},{"line_number":1229,"context_line":"def fixed_ip_get_by_host(context, host):"},{"line_number":1230,"context_line":"    fixed_ips \u003d []"},{"line_number":1231,"context_line":"    for instance in instance_get_all_by_host_light(context, host):"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAOX%2F%2F%2BP0%3D","line":1228,"in_reply_to":"AAAAOX%2F%2F%2FeE%3D","updated":"2013-04-04 01:08:14.000000000","message":"Done","commit_id":"ae8cbc3a290f122f3f4dcbbbb5c84e80be2dd27f"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"4b68135c0eb35e04fd5138b8085b0696a3051b77","unresolved":false,"context_lines":[{"line_number":1228,"context_line":"@require_context"},{"line_number":1229,"context_line":"def fixed_ip_get_by_host(context, host):"},{"line_number":1230,"context_line":"    fixed_ips \u003d []"},{"line_number":1231,"context_line":"    for instance in instance_get_all_by_host_light(context, host):"},{"line_number":1232,"context_line":"        for fixed in fixed_ip_get_by_instance(context, instance[\u0027uuid\u0027]):"},{"line_number":1233,"context_line":"            fixed_ips.append(fixed)"},{"line_number":1234,"context_line":"    return fixed_ips"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAOX%2F%2F%2FcQ%3D","line":1231,"updated":"2013-04-03 12:33:28.000000000","message":"Two nits:\n1) In this case we need only instance.uuid\n2) You shouldn\u0027t make N-queries here.\nIt is possible to make something like\n  model_query(context, models.FixedIp).filter(models.FixedIp.instance_uuid.in_(array_of_uuids_or_query_that_returns_uuids))","commit_id":"ae8cbc3a290f122f3f4dcbbbb5c84e80be2dd27f"},{"author":{"_account_id":2271,"name":"Michael Still","email":"mikal@stillhq.com","username":"mikalstill"},"change_message_id":"1f86fa865f2aa85d6c625d944687ccf790862b1f","unresolved":false,"context_lines":[{"line_number":1228,"context_line":"@require_context"},{"line_number":1229,"context_line":"def fixed_ip_get_by_host(context, host):"},{"line_number":1230,"context_line":"    fixed_ips \u003d []"},{"line_number":1231,"context_line":"    for instance in instance_get_all_by_host_light(context, host):"},{"line_number":1232,"context_line":"        for fixed in fixed_ip_get_by_instance(context, instance[\u0027uuid\u0027]):"},{"line_number":1233,"context_line":"            fixed_ips.append(fixed)"},{"line_number":1234,"context_line":"    return fixed_ips"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAOX%2F%2F%2BP4%3D","line":1231,"in_reply_to":"AAAAOX%2F%2F%2FcQ%3D","updated":"2013-04-04 01:08:14.000000000","message":"Ok, I\u0027ve re-worked this.","commit_id":"ae8cbc3a290f122f3f4dcbbbb5c84e80be2dd27f"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"be44cc196b981e19325facc76e7ff63f986e0795","unresolved":false,"context_lines":[{"line_number":1725,"context_line":""},{"line_number":1726,"context_line":""},{"line_number":1727,"context_line":"@require_admin_context"},{"line_number":1728,"context_line":"def instance_get_all_by_host_light(context, host):"},{"line_number":1729,"context_line":"    \"\"\"Return a list of the instance uuids on a given host."},{"line_number":1730,"context_line":""},{"line_number":1731,"context_line":"    Returns a list of UUIDs, not Instance model objects."}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAOX%2F%2F9w0%3D","line":1728,"updated":"2013-04-04 09:47:13.000000000","message":"Now it only returns the uuid, would instance_get_all_uuid_by_host() or similar, be a better name?","commit_id":"73d5a2f2523b0e3e4ec023c75298ee2cfff13c83"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"be44cc196b981e19325facc76e7ff63f986e0795","unresolved":false,"context_lines":[{"line_number":1735,"context_line":"    metadata \u003d MetaData()"},{"line_number":1736,"context_line":"    metadata.bind \u003d engine"},{"line_number":1737,"context_line":""},{"line_number":1738,"context_line":"    table \u003d Table(\u0027instances\u0027, metadata, autoload\u003dTrue)"},{"line_number":1739,"context_line":"    default_not_deleted_value \u003d _get_default_deleted_value(table)"},{"line_number":1740,"context_line":"    query \u003d select([table.c.uuid],"},{"line_number":1741,"context_line":"                   and_(table.c.host \u003d\u003d host,"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAOX%2F%2F9wA%3D","line":1738,"updated":"2013-04-04 09:47:13.000000000","message":"Not sure why you don\u0027t use model_query, then use add_colums(\"uuid\").all() or something like that? I guess I am missing something, maybe worth a note?","commit_id":"73d5a2f2523b0e3e4ec023c75298ee2cfff13c83"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"970c400dcfd45499620eedf486fc92d1ba60c6ed","unresolved":false,"context_lines":[{"line_number":1737,"context_line":""},{"line_number":1738,"context_line":"    table \u003d Table(\u0027instances\u0027, metadata, autoload\u003dTrue)"},{"line_number":1739,"context_line":"    default_not_deleted_value \u003d _get_default_deleted_value(table)"},{"line_number":1740,"context_line":"    query \u003d select([table.c.uuid],"},{"line_number":1741,"context_line":"                   and_(table.c.host \u003d\u003d host,"},{"line_number":1742,"context_line":"                        table.c.deleted \u003d\u003d default_not_deleted_value))"},{"line_number":1743,"context_line":"    rows \u003d conn.execute(query).fetchall()"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAOX%2F%2F9W0%3D","line":1740,"updated":"2013-04-04 15:31:43.000000000","message":"I don\u0027t know why do you use sqlalchemy expressions here. \n\nYou\u0027re are able to use here model_query here, \n\n  model_query(models.Instances.uuid, read_deleted\u003d\"no\",\n                     base_model\u003dmodels.Instances)\n       .filter_by(host\u003dhost)\n       .all()\n\nAnd one more nit even if you change this you should use one session instances in both methods (to avoid creating of 2 transactions)\n\nBut pls do not add session parameter to public method.","commit_id":"73d5a2f2523b0e3e4ec023c75298ee2cfff13c83"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"4c1f8d2061a22d192f4db0506d2564523e9bb114","unresolved":false,"context_lines":[{"line_number":1811,"context_line":""},{"line_number":1812,"context_line":""},{"line_number":1813,"context_line":"@require_admin_context"},{"line_number":1814,"context_line":"def instance_get_all_uuids_by_host(context, host):"},{"line_number":1815,"context_line":"    \"\"\"Return a list of the instance uuids on a given host."},{"line_number":1816,"context_line":""},{"line_number":1817,"context_line":"    Returns a list of UUIDs, not Instance model objects."}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAOn%2F%2F%2FXg%3D","line":1814,"updated":"2013-04-08 23:27:00.000000000","message":"Are you just exposing this for the good of the order, or is there some use of this function outside this file that I\u0027m missing? If the former, I would think it\u0027d be better to wait to expose it until it\u0027s needed, especially since the reason this bug occurred was that someone removed a method they thought nobody was using :)","commit_id":"9a496821c56fcf05f67dee02d16b28baa05dc554"},{"author":{"_account_id":2271,"name":"Michael Still","email":"mikal@stillhq.com","username":"mikalstill"},"change_message_id":"810975c367d85ac49a4cfc7b3ecb5f87ea601466","unresolved":false,"context_lines":[{"line_number":1811,"context_line":""},{"line_number":1812,"context_line":""},{"line_number":1813,"context_line":"@require_admin_context"},{"line_number":1814,"context_line":"def instance_get_all_uuids_by_host(context, host):"},{"line_number":1815,"context_line":"    \"\"\"Return a list of the instance uuids on a given host."},{"line_number":1816,"context_line":""},{"line_number":1817,"context_line":"    Returns a list of UUIDs, not Instance model objects."}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAOn%2F%2F9ac%3D","line":1814,"in_reply_to":"AAAAOn%2F%2F%2FXg%3D","updated":"2013-04-10 04:39:16.000000000","message":"Done","commit_id":"9a496821c56fcf05f67dee02d16b28baa05dc554"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"4c1f8d2061a22d192f4db0506d2564523e9bb114","unresolved":false,"context_lines":[{"line_number":4879,"context_line":"    # use when Nova is ready to require 0.8."},{"line_number":4880,"context_line":""},{"line_number":4881,"context_line":"    # NOTE(mikal): this is a little confusing. This method returns the value"},{"line_number":4882,"context_line":"    # that a _not_deleted_ row would have."},{"line_number":4883,"context_line":"    deleted_column_type \u003d table.c.deleted.type"},{"line_number":4884,"context_line":"    if isinstance(deleted_column_type, Integer):"},{"line_number":4885,"context_line":"        return 0"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAOn%2F%2F%2FXc%3D","line":4882,"updated":"2013-04-08 23:27:00.000000000","message":"Is this related to the rest of the patch or just a helpful addition?","commit_id":"9a496821c56fcf05f67dee02d16b28baa05dc554"},{"author":{"_account_id":2271,"name":"Michael Still","email":"mikal@stillhq.com","username":"mikalstill"},"change_message_id":"810975c367d85ac49a4cfc7b3ecb5f87ea601466","unresolved":false,"context_lines":[{"line_number":4879,"context_line":"    # use when Nova is ready to require 0.8."},{"line_number":4880,"context_line":""},{"line_number":4881,"context_line":"    # NOTE(mikal): this is a little confusing. This method returns the value"},{"line_number":4882,"context_line":"    # that a _not_deleted_ row would have."},{"line_number":4883,"context_line":"    deleted_column_type \u003d table.c.deleted.type"},{"line_number":4884,"context_line":"    if isinstance(deleted_column_type, Integer):"},{"line_number":4885,"context_line":"        return 0"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAOn%2F%2F9aU%3D","line":4882,"in_reply_to":"AAAAOn%2F%2F%2FXc%3D","updated":"2013-04-10 04:39:16.000000000","message":"This is cause it took me _ages_ to work out why my code didn\u0027t work. Its because I had misunderstood what this function returns. I was hoping to save someone else the confusion later.","commit_id":"9a496821c56fcf05f67dee02d16b28baa05dc554"}]}
