)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"92c037de59ed4dce4abc2484d738bfecae853e8c","unresolved":false,"context_lines":[{"line_number":10,"context_line":"data migration"},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Change-Id: I532051d2e65b62d10cd50cfd47af7919064ea8e5"},{"line_number":13,"context_line":"Partially-Implements: blueprint adopt-oslo-versioned-objects-for-db"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"ffe62b97_02e89bb1","line":13,"range":{"start_line":13,"start_character":22,"end_line":13,"end_character":67},"updated":"2017-03-27 14:52:51.000000000","message":"should be online-upgrades I think","commit_id":"e9607d76196b28882f08a9a926d15e394f48f5a0"}],"neutron/db/migration/alembic_migrations/versions/newton/online/__init__.py":[{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"92c037de59ed4dce4abc2484d738bfecae853e8c","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2017 Intel Corporation"},{"line_number":2,"context_line":"# All Rights Reserved."},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"}],"source_content_type":"text/x-python","patch_set":2,"id":"ffe62b97_222f1ff7","line":1,"updated":"2017-03-27 14:52:51.000000000","message":"I assume you are going to remove this file from the final version of the patch.","commit_id":"e9607d76196b28882f08a9a926d15e394f48f5a0"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"c20edac6f7815dafb1b3002648c556dc82f93712","unresolved":false,"context_lines":[{"line_number":20,"context_line":"from neutron.ipam.drivers.neutrondb_ipam import db_models as ipam_models"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"def migrate_to_pluggable_ipam(context, max_count):"},{"line_number":24,"context_line":"    session \u003d sa.orm.Session(bind\u003dcontext.bind)"},{"line_number":25,"context_line":"    query \u003d session.query("},{"line_number":26,"context_line":"        models_v2.Subnet).outerjoin("}],"source_content_type":"text/x-python","patch_set":2,"id":"1a1ced50_6fb7383a","line":23,"range":{"start_line":23,"start_character":0,"end_line":23,"end_character":50},"updated":"2017-03-22 01:00:52.000000000","message":"Hi Victor, I have a question if you do not mind. I am working on this patch \u003chttps://review.openstack.org/#/c/288271/\u003e, which adds a binding_index column to NetworkDhcpAgentBindings table. Since it involves data migration to the new column, I put it in contract branch. My question is that, if your patch is merged, does it mean that I can add a method similar to migrate_to_pluggable_ipam() to do the data migration online and move my script to expand branch?","commit_id":"e9607d76196b28882f08a9a926d15e394f48f5a0"},{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"eadbfe50afd52ce1dbaee77b0ab30ede0f03d32b","unresolved":false,"context_lines":[{"line_number":20,"context_line":"from neutron.ipam.drivers.neutrondb_ipam import db_models as ipam_models"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"def migrate_to_pluggable_ipam(context, max_count):"},{"line_number":24,"context_line":"    session \u003d sa.orm.Session(bind\u003dcontext.bind)"},{"line_number":25,"context_line":"    query \u003d session.query("},{"line_number":26,"context_line":"        models_v2.Subnet).outerjoin("}],"source_content_type":"text/x-python","patch_set":2,"id":"1a1ced50_6e9aba6f","line":23,"range":{"start_line":23,"start_character":0,"end_line":23,"end_character":50},"in_reply_to":"1a1ced50_6fb7383a","updated":"2017-03-22 17:38:27.000000000","message":"If this gets merge, we\u0027d create a new script that contains a function that deals with the migration of data by chunks.  In this example I used joins to do it, remember that this command will be executed several times until the whole data is migrated.","commit_id":"e9607d76196b28882f08a9a926d15e394f48f5a0"},{"author":{"_account_id":4,"name":"Dolph Mathews","email":"dolph.mathews@gmail.com","username":"dolph"},"change_message_id":"21e729f66247b5dc5cbe57211b7cf2fc91c9cb41","unresolved":false,"context_lines":[{"line_number":37,"context_line":"            id\u003duuidutils.generate_uuid(), neutron_subnet_id\u003dsubnet.id))"},{"line_number":38,"context_line":"    session.flush()"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    return count_all, count_hit"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a1ced50_c48025fa","line":40,"updated":"2017-03-21 16:35:07.000000000","message":"Without being able to return early, why would these two values ever be different? It appears that they\u0027ll always both be max_count by this point. Am I overlooking something?","commit_id":"e9607d76196b28882f08a9a926d15e394f48f5a0"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"92c037de59ed4dce4abc2484d738bfecae853e8c","unresolved":false,"context_lines":[{"line_number":37,"context_line":"            id\u003duuidutils.generate_uuid(), neutron_subnet_id\u003dsubnet.id))"},{"line_number":38,"context_line":"    session.flush()"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    return count_all, count_hit"}],"source_content_type":"text/x-python","patch_set":2,"id":"ffe62b97_c2fab373","line":40,"in_reply_to":"1a1ced50_69b47434","updated":"2017-03-27 14:52:51.000000000","message":"Yeah, seems redundant.","commit_id":"e9607d76196b28882f08a9a926d15e394f48f5a0"},{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"eadbfe50afd52ce1dbaee77b0ab30ede0f03d32b","unresolved":false,"context_lines":[{"line_number":37,"context_line":"            id\u003duuidutils.generate_uuid(), neutron_subnet_id\u003dsubnet.id))"},{"line_number":38,"context_line":"    session.flush()"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    return count_all, count_hit"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a1ced50_69b47434","line":40,"in_reply_to":"1a1ced50_c48025fa","updated":"2017-03-22 17:38:27.000000000","message":"This example was based on the nova\u0027s implementation.  If there is a failure the line 40 won\u0027t be reached, so I\u0027m agree with you, I\u0027m going to doublecheck it.","commit_id":"e9607d76196b28882f08a9a926d15e394f48f5a0"}],"neutron/db/migration/cli.py":[{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"92c037de59ed4dce4abc2484d738bfecae853e8c","unresolved":false,"context_lines":[{"line_number":26,"context_line":"from oslo_utils import fileutils"},{"line_number":27,"context_line":"from oslo_utils import importutils"},{"line_number":28,"context_line":"import pkg_resources"},{"line_number":29,"context_line":"import prettytable"},{"line_number":30,"context_line":"import six"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"from neutron._i18n import _"}],"source_content_type":"text/x-python","patch_set":2,"id":"ffe62b97_24296c89","line":29,"range":{"start_line":29,"start_character":7,"end_line":29,"end_character":18},"updated":"2017-03-27 14:52:51.000000000","message":"is it a new dependency? should it then be in requirements.txt?","commit_id":"e9607d76196b28882f08a9a926d15e394f48f5a0"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"92c037de59ed4dce4abc2484d738bfecae853e8c","unresolved":false,"context_lines":[{"line_number":61,"context_line":"}"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"ONLINE_MIGRATIONS \u003d ("},{"line_number":64,"context_line":"    online_newton.migrate_to_pluggable_ipam,"},{"line_number":65,"context_line":")"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"neutron_alembic_ini \u003d os.path.join(os.path.dirname(__file__), \u0027alembic.ini\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"ffe62b97_42634343","line":64,"updated":"2017-03-27 14:52:51.000000000","message":"we will need external plugins to be able to utilize the mechanism, so instead of listing functions here, introduce a new stevedore namespace in setup.cfg (let\u0027s say neutron.data_migration) and execute everything from the iterator through the namespace.\n\nThis should be documented in devref. I think doc/source/devref/alembic_migrations.rst may be a good fit for that. While at it, please review if the document needs any updates.","commit_id":"e9607d76196b28882f08a9a926d15e394f48f5a0"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"e807761c4036d10a2426be5c8d8f60730c3baeb0","unresolved":false,"context_lines":[{"line_number":61,"context_line":"}"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"ONLINE_MIGRATIONS \u003d ("},{"line_number":64,"context_line":"    online_newton.migrate_to_pluggable_ipam,"},{"line_number":65,"context_line":")"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"neutron_alembic_ini \u003d os.path.join(os.path.dirname(__file__), \u0027alembic.ini\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"5ff73747_94771ea1","line":64,"in_reply_to":"ffe62b97_42634343","updated":"2017-04-27 21:44:56.000000000","message":"+1 for documentation,","commit_id":"e9607d76196b28882f08a9a926d15e394f48f5a0"},{"author":{"_account_id":4,"name":"Dolph Mathews","email":"dolph.mathews@gmail.com","username":"dolph"},"change_message_id":"21e729f66247b5dc5cbe57211b7cf2fc91c9cb41","unresolved":false,"context_lines":[{"line_number":438,"context_line":"def online_data_migrations(config, cmd):"},{"line_number":439,"context_line":"    if CONF.command.max_count is not None:"},{"line_number":440,"context_line":"        try:"},{"line_number":441,"context_line":"            max_count \u003d int(CONF.command.max_count)"},{"line_number":442,"context_line":"        except ValueError:"},{"line_number":443,"context_line":"            max_count \u003d -1"},{"line_number":444,"context_line":"        unlimited \u003d False"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a1ced50_e78603da","line":441,"updated":"2017-03-21 16:35:07.000000000","message":"You\u0027ve already defined this to be an integer type in the CONF declaration below. Give it a reasonable default value (-1, if you really want, although I\u0027d take advantage of the None to represent the value of both \"unlimited\" and \"max_count\" to eliminate the consequential variable), and you can skip this entire try/except.","commit_id":"e9607d76196b28882f08a9a926d15e394f48f5a0"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"e807761c4036d10a2426be5c8d8f60730c3baeb0","unresolved":false,"context_lines":[{"line_number":438,"context_line":"def online_data_migrations(config, cmd):"},{"line_number":439,"context_line":"    if CONF.command.max_count is not None:"},{"line_number":440,"context_line":"        try:"},{"line_number":441,"context_line":"            max_count \u003d int(CONF.command.max_count)"},{"line_number":442,"context_line":"        except ValueError:"},{"line_number":443,"context_line":"            max_count \u003d -1"},{"line_number":444,"context_line":"        unlimited \u003d False"}],"source_content_type":"text/x-python","patch_set":2,"id":"5ff73747_5459968b","line":441,"in_reply_to":"1a1ced50_e78603da","updated":"2017-04-27 21:44:56.000000000","message":"Done","commit_id":"e9607d76196b28882f08a9a926d15e394f48f5a0"},{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"eadbfe50afd52ce1dbaee77b0ab30ede0f03d32b","unresolved":false,"context_lines":[{"line_number":438,"context_line":"def online_data_migrations(config, cmd):"},{"line_number":439,"context_line":"    if CONF.command.max_count is not None:"},{"line_number":440,"context_line":"        try:"},{"line_number":441,"context_line":"            max_count \u003d int(CONF.command.max_count)"},{"line_number":442,"context_line":"        except ValueError:"},{"line_number":443,"context_line":"            max_count \u003d -1"},{"line_number":444,"context_line":"        unlimited \u003d False"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a1ced50_8961b0ab","line":441,"in_reply_to":"1a1ced50_e78603da","updated":"2017-03-22 17:38:27.000000000","message":"Ok, thanks","commit_id":"e9607d76196b28882f08a9a926d15e394f48f5a0"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"92c037de59ed4dce4abc2484d738bfecae853e8c","unresolved":false,"context_lines":[{"line_number":444,"context_line":"        unlimited \u003d False"},{"line_number":445,"context_line":"        if max_count \u003c 1:"},{"line_number":446,"context_line":"            print(_(\u0027Must supply a positive value for max_number\u0027))"},{"line_number":447,"context_line":"            return 127"},{"line_number":448,"context_line":"    else:"},{"line_number":449,"context_line":"        unlimited \u003d True"},{"line_number":450,"context_line":"        max_count \u003d 50"}],"source_content_type":"text/x-python","patch_set":2,"id":"ffe62b97_e27017df","line":447,"range":{"start_line":447,"start_character":19,"end_line":447,"end_character":22},"updated":"2017-03-27 14:52:51.000000000","message":"those should be constants at the start of the file with meaningful names. Besides, I think it\u0027s ok to just return 1 as in some other places.","commit_id":"e9607d76196b28882f08a9a926d15e394f48f5a0"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"e807761c4036d10a2426be5c8d8f60730c3baeb0","unresolved":false,"context_lines":[{"line_number":444,"context_line":"        unlimited \u003d False"},{"line_number":445,"context_line":"        if max_count \u003c 1:"},{"line_number":446,"context_line":"            print(_(\u0027Must supply a positive value for max_number\u0027))"},{"line_number":447,"context_line":"            return 127"},{"line_number":448,"context_line":"    else:"},{"line_number":449,"context_line":"        unlimited \u003d True"},{"line_number":450,"context_line":"        max_count \u003d 50"}],"source_content_type":"text/x-python","patch_set":2,"id":"5ff73747_7468121c","line":447,"range":{"start_line":447,"start_character":19,"end_line":447,"end_character":22},"in_reply_to":"ffe62b97_e27017df","updated":"2017-04-27 21:44:56.000000000","message":"Done","commit_id":"e9607d76196b28882f08a9a926d15e394f48f5a0"},{"author":{"_account_id":4,"name":"Dolph Mathews","email":"dolph.mathews@gmail.com","username":"dolph"},"change_message_id":"21e729f66247b5dc5cbe57211b7cf2fc91c9cb41","unresolved":false,"context_lines":[{"line_number":447,"context_line":"            return 127"},{"line_number":448,"context_line":"    else:"},{"line_number":449,"context_line":"        unlimited \u003d True"},{"line_number":450,"context_line":"        max_count \u003d 50"},{"line_number":451,"context_line":"    print(_(\u0027Running batches of %i until complete\u0027) % max_count)"},{"line_number":452,"context_line":""},{"line_number":453,"context_line":"    with DBConnection(config.neutron_config.database.connection) as conn:"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a1ced50_47fb5747","line":450,"updated":"2017-03-21 16:35:07.000000000","message":"Put this in a value in a constant at the top of the file.","commit_id":"e9607d76196b28882f08a9a926d15e394f48f5a0"},{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"eadbfe50afd52ce1dbaee77b0ab30ede0f03d32b","unresolved":false,"context_lines":[{"line_number":447,"context_line":"            return 127"},{"line_number":448,"context_line":"    else:"},{"line_number":449,"context_line":"        unlimited \u003d True"},{"line_number":450,"context_line":"        max_count \u003d 50"},{"line_number":451,"context_line":"    print(_(\u0027Running batches of %i until complete\u0027) % max_count)"},{"line_number":452,"context_line":""},{"line_number":453,"context_line":"    with DBConnection(config.neutron_config.database.connection) as conn:"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a1ced50_c90e48e4","line":450,"in_reply_to":"1a1ced50_47fb5747","updated":"2017-03-22 17:38:27.000000000","message":"Done","commit_id":"e9607d76196b28882f08a9a926d15e394f48f5a0"},{"author":{"_account_id":4,"name":"Dolph Mathews","email":"dolph.mathews@gmail.com","username":"dolph"},"change_message_id":"21e729f66247b5dc5cbe57211b7cf2fc91c9cb41","unresolved":false,"context_lines":[{"line_number":457,"context_line":"        ctxt \u003d alembic_migration.MigrationContext.configure("},{"line_number":458,"context_line":"            conn, opts\u003dopts)"},{"line_number":459,"context_line":""},{"line_number":460,"context_line":"        ran \u003d None"},{"line_number":461,"context_line":"        migration_info \u003d {}"},{"line_number":462,"context_line":"        while ran is None or ran !\u003d 0:"},{"line_number":463,"context_line":"            migrations \u003d _run_migration(ctxt, max_count)"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a1ced50_27a3bb9e","line":460,"updated":"2017-03-21 16:35:07.000000000","message":"Ran is a verb, that doesn\u0027t tell me what it\u0027s keeping track of. total_migrations_ran ?","commit_id":"e9607d76196b28882f08a9a926d15e394f48f5a0"},{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"eadbfe50afd52ce1dbaee77b0ab30ede0f03d32b","unresolved":false,"context_lines":[{"line_number":457,"context_line":"        ctxt \u003d alembic_migration.MigrationContext.configure("},{"line_number":458,"context_line":"            conn, opts\u003dopts)"},{"line_number":459,"context_line":""},{"line_number":460,"context_line":"        ran \u003d None"},{"line_number":461,"context_line":"        migration_info \u003d {}"},{"line_number":462,"context_line":"        while ran is None or ran !\u003d 0:"},{"line_number":463,"context_line":"            migrations \u003d _run_migration(ctxt, max_count)"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a1ced50_e9114405","line":460,"in_reply_to":"1a1ced50_27a3bb9e","updated":"2017-03-22 17:38:27.000000000","message":"Done","commit_id":"e9607d76196b28882f08a9a926d15e394f48f5a0"},{"author":{"_account_id":4,"name":"Dolph Mathews","email":"dolph.mathews@gmail.com","username":"dolph"},"change_message_id":"21e729f66247b5dc5cbe57211b7cf2fc91c9cb41","unresolved":false,"context_lines":[{"line_number":462,"context_line":"        while ran is None or ran !\u003d 0:"},{"line_number":463,"context_line":"            migrations \u003d _run_migration(ctxt, max_count)"},{"line_number":464,"context_line":"            migration_info.update(migrations)"},{"line_number":465,"context_line":"            ran \u003d sum([done for found, done in migrations.values()])"},{"line_number":466,"context_line":"            if not unlimited:"},{"line_number":467,"context_line":"                break"},{"line_number":468,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"1a1ced50_c7fca774","line":465,"updated":"2017-03-21 16:35:07.000000000","message":"I suspect this can be substantially simplified considering the value entirely discarded by the end of the method in favor of a boolean, anyway.","commit_id":"e9607d76196b28882f08a9a926d15e394f48f5a0"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"92c037de59ed4dce4abc2484d738bfecae853e8c","unresolved":false,"context_lines":[{"line_number":469,"context_line":"    t \u003d prettytable.PrettyTable([_(\u0027Migration\u0027),"},{"line_number":470,"context_line":"                                 _(\u0027Total Needed\u0027),"},{"line_number":471,"context_line":"                                 _(\u0027Completed\u0027)])"},{"line_number":472,"context_line":"    for name in sorted(migration_info.keys()):"},{"line_number":473,"context_line":"        info \u003d migration_info[name]"},{"line_number":474,"context_line":"        t.add_row([name, info[0], info[1]])"},{"line_number":475,"context_line":"    print(t)"}],"source_content_type":"text/x-python","patch_set":2,"id":"ffe62b97_e4570402","line":472,"range":{"start_line":472,"start_character":16,"end_line":472,"end_character":22},"updated":"2017-03-27 14:52:51.000000000","message":"why do we need to sort? the order is random.","commit_id":"e9607d76196b28882f08a9a926d15e394f48f5a0"},{"author":{"_account_id":4,"name":"Dolph Mathews","email":"dolph.mathews@gmail.com","username":"dolph"},"change_message_id":"21e729f66247b5dc5cbe57211b7cf2fc91c9cb41","unresolved":false,"context_lines":[{"line_number":470,"context_line":"                                 _(\u0027Total Needed\u0027),"},{"line_number":471,"context_line":"                                 _(\u0027Completed\u0027)])"},{"line_number":472,"context_line":"    for name in sorted(migration_info.keys()):"},{"line_number":473,"context_line":"        info \u003d migration_info[name]"},{"line_number":474,"context_line":"        t.add_row([name, info[0], info[1]])"},{"line_number":475,"context_line":"    print(t)"},{"line_number":476,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"1a1ced50_47c7d763","line":473,"updated":"2017-03-21 16:35:07.000000000","message":"I\u0027d suggest either breaking \"info\" (which is a particularly vague variable name) into some useful names:\n\n  total_needed, completed \u003d migration_info[name]\n\nor not perform this indirection at all, as the indirection does not provide any benefit as-is:\n\n  t.add_row([name, migration_info[name][0], migration_info[name][1])\n\nThe second option is equally obscure but easier to follow along with, as there are less variables to keep track of.","commit_id":"e9607d76196b28882f08a9a926d15e394f48f5a0"},{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"eadbfe50afd52ce1dbaee77b0ab30ede0f03d32b","unresolved":false,"context_lines":[{"line_number":470,"context_line":"                                 _(\u0027Total Needed\u0027),"},{"line_number":471,"context_line":"                                 _(\u0027Completed\u0027)])"},{"line_number":472,"context_line":"    for name in sorted(migration_info.keys()):"},{"line_number":473,"context_line":"        info \u003d migration_info[name]"},{"line_number":474,"context_line":"        t.add_row([name, info[0], info[1]])"},{"line_number":475,"context_line":"    print(t)"},{"line_number":476,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"1a1ced50_c9fd686f","line":473,"in_reply_to":"1a1ced50_47c7d763","updated":"2017-03-22 17:38:27.000000000","message":"Well, the second one will simplify it.","commit_id":"e9607d76196b28882f08a9a926d15e394f48f5a0"},{"author":{"_account_id":4,"name":"Dolph Mathews","email":"dolph.mathews@gmail.com","username":"dolph"},"change_message_id":"21e729f66247b5dc5cbe57211b7cf2fc91c9cb41","unresolved":false,"context_lines":[{"line_number":474,"context_line":"        t.add_row([name, info[0], info[1]])"},{"line_number":475,"context_line":"    print(t)"},{"line_number":476,"context_line":""},{"line_number":477,"context_line":"    return ran and 1 or 0"},{"line_number":478,"context_line":""},{"line_number":479,"context_line":""},{"line_number":480,"context_line":"def add_command_parsers(subparsers):"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a1ced50_27dd7b6f","line":477,"updated":"2017-03-21 16:35:07.000000000","message":"This would make it much more clear what you\u0027re doing:\n\n  return int(bool(ran)) ?\n\nAlthough I\u0027m not clear why you would return non-zero if you successfully ran migrations?","commit_id":"e9607d76196b28882f08a9a926d15e394f48f5a0"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"e807761c4036d10a2426be5c8d8f60730c3baeb0","unresolved":false,"context_lines":[{"line_number":474,"context_line":"        t.add_row([name, info[0], info[1]])"},{"line_number":475,"context_line":"    print(t)"},{"line_number":476,"context_line":""},{"line_number":477,"context_line":"    return ran and 1 or 0"},{"line_number":478,"context_line":""},{"line_number":479,"context_line":""},{"line_number":480,"context_line":"def add_command_parsers(subparsers):"}],"source_content_type":"text/x-python","patch_set":2,"id":"5ff73747_37ce0cb4","line":477,"in_reply_to":"1a1ced50_27dd7b6f","updated":"2017-04-27 21:44:56.000000000","message":"I am not sure why returning int value is required although we are done with migrations here, we can just return status message which we can set to some error message in the beginning and on successful migration it can be overwritten.","commit_id":"e9607d76196b28882f08a9a926d15e394f48f5a0"},{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"eadbfe50afd52ce1dbaee77b0ab30ede0f03d32b","unresolved":false,"context_lines":[{"line_number":474,"context_line":"        t.add_row([name, info[0], info[1]])"},{"line_number":475,"context_line":"    print(t)"},{"line_number":476,"context_line":""},{"line_number":477,"context_line":"    return ran and 1 or 0"},{"line_number":478,"context_line":""},{"line_number":479,"context_line":""},{"line_number":480,"context_line":"def add_command_parsers(subparsers):"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a1ced50_a9666c4e","line":477,"in_reply_to":"1a1ced50_27dd7b6f","updated":"2017-03-22 17:38:27.000000000","message":"it\u0027s considering a failure if there were no data migrated, maybe it\u0027s a way to break an iteration in a script.","commit_id":"e9607d76196b28882f08a9a926d15e394f48f5a0"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"92c037de59ed4dce4abc2484d738bfecae853e8c","unresolved":false,"context_lines":[{"line_number":527,"context_line":"    parser.set_defaults(func\u003dhas_offline_migrations)"},{"line_number":528,"context_line":""},{"line_number":529,"context_line":"    parser \u003d subparsers.add_parser("},{"line_number":530,"context_line":"        \u0027online_data_migrations\u0027,"},{"line_number":531,"context_line":"        help\u003d\u0027Coverts old records into a newer format. This has to be \u0027"},{"line_number":532,"context_line":"             \u0027completed before you contract the database schema\u0027)"},{"line_number":533,"context_line":"    parser.add_argument("}],"source_content_type":"text/x-python","patch_set":2,"id":"ffe62b97_e4a5c405","line":530,"range":{"start_line":530,"start_character":9,"end_line":530,"end_character":31},"updated":"2017-03-27 14:52:51.000000000","message":"maybe data-migrate or migrate-data? (verb not a noun)?","commit_id":"e9607d76196b28882f08a9a926d15e394f48f5a0"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"e807761c4036d10a2426be5c8d8f60730c3baeb0","unresolved":false,"context_lines":[{"line_number":527,"context_line":"    parser.set_defaults(func\u003dhas_offline_migrations)"},{"line_number":528,"context_line":""},{"line_number":529,"context_line":"    parser \u003d subparsers.add_parser("},{"line_number":530,"context_line":"        \u0027online_data_migrations\u0027,"},{"line_number":531,"context_line":"        help\u003d\u0027Coverts old records into a newer format. This has to be \u0027"},{"line_number":532,"context_line":"             \u0027completed before you contract the database schema\u0027)"},{"line_number":533,"context_line":"    parser.add_argument("}],"source_content_type":"text/x-python","patch_set":2,"id":"5ff73747_57af587c","line":530,"range":{"start_line":530,"start_character":9,"end_line":530,"end_character":31},"in_reply_to":"ffe62b97_e4a5c405","updated":"2017-04-27 21:44:56.000000000","message":"Done","commit_id":"e9607d76196b28882f08a9a926d15e394f48f5a0"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"92c037de59ed4dce4abc2484d738bfecae853e8c","unresolved":false,"context_lines":[{"line_number":528,"context_line":""},{"line_number":529,"context_line":"    parser \u003d subparsers.add_parser("},{"line_number":530,"context_line":"        \u0027online_data_migrations\u0027,"},{"line_number":531,"context_line":"        help\u003d\u0027Coverts old records into a newer format. This has to be \u0027"},{"line_number":532,"context_line":"             \u0027completed before you contract the database schema\u0027)"},{"line_number":533,"context_line":"    parser.add_argument("},{"line_number":534,"context_line":"        \u0027--max-count\u0027, type\u003dint, help\u003d\u0027Maximum number of objects to consider\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"ffe62b97_84aa78cf","line":531,"range":{"start_line":531,"start_character":14,"end_line":531,"end_character":21},"updated":"2017-03-27 14:52:51.000000000","message":"Convert","commit_id":"e9607d76196b28882f08a9a926d15e394f48f5a0"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"e807761c4036d10a2426be5c8d8f60730c3baeb0","unresolved":false,"context_lines":[{"line_number":528,"context_line":""},{"line_number":529,"context_line":"    parser \u003d subparsers.add_parser("},{"line_number":530,"context_line":"        \u0027online_data_migrations\u0027,"},{"line_number":531,"context_line":"        help\u003d\u0027Coverts old records into a newer format. This has to be \u0027"},{"line_number":532,"context_line":"             \u0027completed before you contract the database schema\u0027)"},{"line_number":533,"context_line":"    parser.add_argument("},{"line_number":534,"context_line":"        \u0027--max-count\u0027, type\u003dint, help\u003d\u0027Maximum number of objects to consider\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"5ff73747_97b960cd","line":531,"range":{"start_line":531,"start_character":14,"end_line":531,"end_character":21},"in_reply_to":"ffe62b97_84aa78cf","updated":"2017-04-27 21:44:56.000000000","message":"Done","commit_id":"e9607d76196b28882f08a9a926d15e394f48f5a0"},{"author":{"_account_id":4,"name":"Dolph Mathews","email":"dolph.mathews@gmail.com","username":"dolph"},"change_message_id":"21e729f66247b5dc5cbe57211b7cf2fc91c9cb41","unresolved":false,"context_lines":[{"line_number":529,"context_line":"    parser \u003d subparsers.add_parser("},{"line_number":530,"context_line":"        \u0027online_data_migrations\u0027,"},{"line_number":531,"context_line":"        help\u003d\u0027Coverts old records into a newer format. This has to be \u0027"},{"line_number":532,"context_line":"             \u0027completed before you contract the database schema\u0027)"},{"line_number":533,"context_line":"    parser.add_argument("},{"line_number":534,"context_line":"        \u0027--max-count\u0027, type\u003dint, help\u003d\u0027Maximum number of objects to consider\u0027)"},{"line_number":535,"context_line":"    parser.set_defaults(func\u003donline_data_migrations)"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a1ced50_42c7c563","line":532,"updated":"2017-03-21 16:35:07.000000000","message":"As an aside, Neutron should have a check to enforce this order of operations, if it doesn\u0027t already!","commit_id":"e9607d76196b28882f08a9a926d15e394f48f5a0"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"92c037de59ed4dce4abc2484d738bfecae853e8c","unresolved":false,"context_lines":[{"line_number":529,"context_line":"    parser \u003d subparsers.add_parser("},{"line_number":530,"context_line":"        \u0027online_data_migrations\u0027,"},{"line_number":531,"context_line":"        help\u003d\u0027Coverts old records into a newer format. This has to be \u0027"},{"line_number":532,"context_line":"             \u0027completed before you contract the database schema\u0027)"},{"line_number":533,"context_line":"    parser.add_argument("},{"line_number":534,"context_line":"        \u0027--max-count\u0027, type\u003dint, help\u003d\u0027Maximum number of objects to consider\u0027)"},{"line_number":535,"context_line":"    parser.set_defaults(func\u003donline_data_migrations)"}],"source_content_type":"text/x-python","patch_set":2,"id":"ffe62b97_0488a86e","line":532,"range":{"start_line":532,"start_character":62,"end_line":532,"end_character":63},"updated":"2017-03-27 14:52:51.000000000","message":"nit: add trailing dot","commit_id":"e9607d76196b28882f08a9a926d15e394f48f5a0"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"92c037de59ed4dce4abc2484d738bfecae853e8c","unresolved":false,"context_lines":[{"line_number":529,"context_line":"    parser \u003d subparsers.add_parser("},{"line_number":530,"context_line":"        \u0027online_data_migrations\u0027,"},{"line_number":531,"context_line":"        help\u003d\u0027Coverts old records into a newer format. This has to be \u0027"},{"line_number":532,"context_line":"             \u0027completed before you contract the database schema\u0027)"},{"line_number":533,"context_line":"    parser.add_argument("},{"line_number":534,"context_line":"        \u0027--max-count\u0027, type\u003dint, help\u003d\u0027Maximum number of objects to consider\u0027)"},{"line_number":535,"context_line":"    parser.set_defaults(func\u003donline_data_migrations)"}],"source_content_type":"text/x-python","patch_set":2,"id":"ffe62b97_448d9079","line":532,"in_reply_to":"1a1ced50_42c7c563","updated":"2017-03-27 14:52:51.000000000","message":"We don\u0027t have online_data_migrations yet, so we can follow up on it separately.","commit_id":"e9607d76196b28882f08a9a926d15e394f48f5a0"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"92c037de59ed4dce4abc2484d738bfecae853e8c","unresolved":false,"context_lines":[{"line_number":653,"context_line":"def _run_migration(ctxt, max_count):"},{"line_number":654,"context_line":"    ran \u003d 0"},{"line_number":655,"context_line":"    migrations \u003d {}"},{"line_number":656,"context_line":"    for migration_meth in ONLINE_MIGRATIONS:"},{"line_number":657,"context_line":"        count \u003d max_count - ran"},{"line_number":658,"context_line":"        try:"},{"line_number":659,"context_line":"            found, done \u003d migration_meth(ctxt, count)"}],"source_content_type":"text/x-python","patch_set":2,"id":"ffe62b97_84d8387f","line":656,"range":{"start_line":656,"start_character":18,"end_line":656,"end_character":22},"updated":"2017-03-27 14:52:51.000000000","message":"breaking bad much? not to say that it\u0027s not even a method (it\u0027s a function)","commit_id":"e9607d76196b28882f08a9a926d15e394f48f5a0"},{"author":{"_account_id":4,"name":"Dolph Mathews","email":"dolph.mathews@gmail.com","username":"dolph"},"change_message_id":"21e729f66247b5dc5cbe57211b7cf2fc91c9cb41","unresolved":false,"context_lines":[{"line_number":654,"context_line":"    ran \u003d 0"},{"line_number":655,"context_line":"    migrations \u003d {}"},{"line_number":656,"context_line":"    for migration_meth in ONLINE_MIGRATIONS:"},{"line_number":657,"context_line":"        count \u003d max_count - ran"},{"line_number":658,"context_line":"        try:"},{"line_number":659,"context_line":"            found, done \u003d migration_meth(ctxt, count)"},{"line_number":660,"context_line":"        except Exception:"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a1ced50_e29c315f","line":657,"updated":"2017-03-21 16:35:07.000000000","message":"Is count the remaining migrations to run, then?","commit_id":"e9607d76196b28882f08a9a926d15e394f48f5a0"},{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"eadbfe50afd52ce1dbaee77b0ab30ede0f03d32b","unresolved":false,"context_lines":[{"line_number":654,"context_line":"    ran \u003d 0"},{"line_number":655,"context_line":"    migrations \u003d {}"},{"line_number":656,"context_line":"    for migration_meth in ONLINE_MIGRATIONS:"},{"line_number":657,"context_line":"        count \u003d max_count - ran"},{"line_number":658,"context_line":"        try:"},{"line_number":659,"context_line":"            found, done \u003d migration_meth(ctxt, count)"},{"line_number":660,"context_line":"        except Exception:"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a1ced50_f39e8e61","line":657,"in_reply_to":"1a1ced50_e29c315f","updated":"2017-03-22 17:38:27.000000000","message":"I realized that this doesn\u0027t make sense. I guess the idea is to read the configuration value and using it as a limit inside of the migration_meth function. In other words, if the configuration is set to 50 rows and the user specifies 120 max count, it will migrate chucks of 50 rows in three rounds (50 + 50 + 20).  Sadly, I haven\u0027t found a nova example that supports my idea\n\n* https://github.com/openstack/nova/blob/master/nova/db/sqlalchemy/api.py#L6518-L6534\n* https://github.com/openstack/nova/blob/master/nova/cmd/manage.py#L736-L761","commit_id":"e9607d76196b28882f08a9a926d15e394f48f5a0"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"e807761c4036d10a2426be5c8d8f60730c3baeb0","unresolved":false,"context_lines":[{"line_number":654,"context_line":"    ran \u003d 0"},{"line_number":655,"context_line":"    migrations \u003d {}"},{"line_number":656,"context_line":"    for migration_meth in ONLINE_MIGRATIONS:"},{"line_number":657,"context_line":"        count \u003d max_count - ran"},{"line_number":658,"context_line":"        try:"},{"line_number":659,"context_line":"            found, done \u003d migration_meth(ctxt, count)"},{"line_number":660,"context_line":"        except Exception:"}],"source_content_type":"text/x-python","patch_set":2,"id":"5ff73747_a5642223","line":657,"in_reply_to":"1a1ced50_f39e8e61","updated":"2017-04-27 21:44:56.000000000","message":"IMHO this is useless,  unless I misunderstood","commit_id":"e9607d76196b28882f08a9a926d15e394f48f5a0"},{"author":{"_account_id":4,"name":"Dolph Mathews","email":"dolph.mathews@gmail.com","username":"dolph"},"change_message_id":"21e729f66247b5dc5cbe57211b7cf2fc91c9cb41","unresolved":false,"context_lines":[{"line_number":658,"context_line":"        try:"},{"line_number":659,"context_line":"            found, done \u003d migration_meth(ctxt, count)"},{"line_number":660,"context_line":"        except Exception:"},{"line_number":661,"context_line":"            print(_(\"Error attempting to run %(method)s\") % dict("},{"line_number":662,"context_line":"                  method\u003dmigration_meth))"},{"line_number":663,"context_line":"            found \u003d done \u003d 0"},{"line_number":664,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"1a1ced50_02cdcd65","line":661,"updated":"2017-03-21 16:35:07.000000000","message":"This is throwing away ALL the information about the specific exception, making this impossible for anyone to debug without modifying the code, and the message is going to stdout on top of that :(\n\nUse LOG.exception() instead of print() here, at the very least.","commit_id":"e9607d76196b28882f08a9a926d15e394f48f5a0"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"92c037de59ed4dce4abc2484d738bfecae853e8c","unresolved":false,"context_lines":[{"line_number":658,"context_line":"        try:"},{"line_number":659,"context_line":"            found, done \u003d migration_meth(ctxt, count)"},{"line_number":660,"context_line":"        except Exception:"},{"line_number":661,"context_line":"            print(_(\"Error attempting to run %(method)s\") % dict("},{"line_number":662,"context_line":"                  method\u003dmigration_meth))"},{"line_number":663,"context_line":"            found \u003d done \u003d 0"},{"line_number":664,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"ffe62b97_043b089c","line":661,"range":{"start_line":661,"start_character":47,"end_line":661,"end_character":53},"updated":"2017-03-27 14:52:51.000000000","message":"it\u0027s a callable/function, not a method","commit_id":"e9607d76196b28882f08a9a926d15e394f48f5a0"},{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"eadbfe50afd52ce1dbaee77b0ab30ede0f03d32b","unresolved":false,"context_lines":[{"line_number":658,"context_line":"        try:"},{"line_number":659,"context_line":"            found, done \u003d migration_meth(ctxt, count)"},{"line_number":660,"context_line":"        except Exception:"},{"line_number":661,"context_line":"            print(_(\"Error attempting to run %(method)s\") % dict("},{"line_number":662,"context_line":"                  method\u003dmigration_meth))"},{"line_number":663,"context_line":"            found \u003d done \u003d 0"},{"line_number":664,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"1a1ced50_2d77e7a0","line":661,"in_reply_to":"1a1ced50_02cdcd65","updated":"2017-03-22 17:38:27.000000000","message":"Done","commit_id":"e9607d76196b28882f08a9a926d15e394f48f5a0"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"92c037de59ed4dce4abc2484d738bfecae853e8c","unresolved":false,"context_lines":[{"line_number":658,"context_line":"        try:"},{"line_number":659,"context_line":"            found, done \u003d migration_meth(ctxt, count)"},{"line_number":660,"context_line":"        except Exception:"},{"line_number":661,"context_line":"            print(_(\"Error attempting to run %(method)s\") % dict("},{"line_number":662,"context_line":"                  method\u003dmigration_meth))"},{"line_number":663,"context_line":"            found \u003d done \u003d 0"},{"line_number":664,"context_line":""},{"line_number":665,"context_line":"        name \u003d migration_meth.__name__"}],"source_content_type":"text/x-python","patch_set":2,"id":"ffe62b97_c45d20ea","line":662,"range":{"start_line":661,"start_character":60,"end_line":662,"end_character":40},"updated":"2017-03-27 14:52:51.000000000","message":"what\u0027s the point of constructing a dict for a single value? can\u0027t we just %s?","commit_id":"e9607d76196b28882f08a9a926d15e394f48f5a0"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"92c037de59ed4dce4abc2484d738bfecae853e8c","unresolved":false,"context_lines":[{"line_number":662,"context_line":"                  method\u003dmigration_meth))"},{"line_number":663,"context_line":"            found \u003d done \u003d 0"},{"line_number":664,"context_line":""},{"line_number":665,"context_line":"        name \u003d migration_meth.__name__"},{"line_number":666,"context_line":"        if found:"},{"line_number":667,"context_line":"            print(_(\u0027%(total)i rows matched query %(meth)s, %(done)i \u0027"},{"line_number":668,"context_line":"                    \u0027migrated\u0027) % {\u0027total\u0027: found,"}],"source_content_type":"text/x-python","patch_set":2,"id":"ffe62b97_4417d0ee","line":665,"range":{"start_line":665,"start_character":8,"end_line":665,"end_character":38},"updated":"2017-03-27 14:52:51.000000000","message":"once you will have stevedore aliases, you will use those instead","commit_id":"e9607d76196b28882f08a9a926d15e394f48f5a0"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"92c037de59ed4dce4abc2484d738bfecae853e8c","unresolved":false,"context_lines":[{"line_number":664,"context_line":""},{"line_number":665,"context_line":"        name \u003d migration_meth.__name__"},{"line_number":666,"context_line":"        if found:"},{"line_number":667,"context_line":"            print(_(\u0027%(total)i rows matched query %(meth)s, %(done)i \u0027"},{"line_number":668,"context_line":"                    \u0027migrated\u0027) % {\u0027total\u0027: found,"},{"line_number":669,"context_line":"                                   \u0027meth\u0027: name,"},{"line_number":670,"context_line":"                                   \u0027done\u0027: done})"}],"source_content_type":"text/x-python","patch_set":2,"id":"ffe62b97_84f4b8d0","line":667,"range":{"start_line":667,"start_character":29,"end_line":667,"end_character":30},"updated":"2017-03-27 14:52:51.000000000","message":"(No action required) it\u0027s more common to use %d in neutron tree","commit_id":"e9607d76196b28882f08a9a926d15e394f48f5a0"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"92c037de59ed4dce4abc2484d738bfecae853e8c","unresolved":false,"context_lines":[{"line_number":668,"context_line":"                    \u0027migrated\u0027) % {\u0027total\u0027: found,"},{"line_number":669,"context_line":"                                   \u0027meth\u0027: name,"},{"line_number":670,"context_line":"                                   \u0027done\u0027: done})"},{"line_number":671,"context_line":"        migrations.setdefault(name, (0, 0))"},{"line_number":672,"context_line":"        migrations[name] \u003d (migrations[name][0] + found,"},{"line_number":673,"context_line":"                            migrations[name][1] + done)"},{"line_number":674,"context_line":"        if max_count is not None:"}],"source_content_type":"text/x-python","patch_set":2,"id":"ffe62b97_a4d0dc20","line":671,"range":{"start_line":671,"start_character":36,"end_line":671,"end_character":43},"updated":"2017-03-27 14:52:51.000000000","message":"going to be 0 once you switch to a single value returned from the migration function.","commit_id":"e9607d76196b28882f08a9a926d15e394f48f5a0"},{"author":{"_account_id":4,"name":"Dolph Mathews","email":"dolph.mathews@gmail.com","username":"dolph"},"change_message_id":"21e729f66247b5dc5cbe57211b7cf2fc91c9cb41","unresolved":false,"context_lines":[{"line_number":677,"context_line":"                break"},{"line_number":678,"context_line":"    return migrations"},{"line_number":679,"context_line":""},{"line_number":680,"context_line":""},{"line_number":681,"context_line":"def get_alembic_version_table(config):"},{"line_number":682,"context_line":"    script_dir \u003d alembic_script.ScriptDirectory.from_config(config)"},{"line_number":683,"context_line":"    alembic_version_table \u003d [None]"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a1ced50_629be172","line":680,"updated":"2017-03-21 16:35:07.000000000","message":"Several of my comments on the other method apply here as well.","commit_id":"e9607d76196b28882f08a9a926d15e394f48f5a0"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"c26f52c5c29003bbf66f32092b0c595706d8d110","unresolved":false,"context_lines":[{"line_number":445,"context_line":"    if CONF.command.max_count is not None:"},{"line_number":446,"context_line":"        max_count \u003d CONF.command.max_count"},{"line_number":447,"context_line":"        unlimited \u003d False"},{"line_number":448,"context_line":"        if max_count \u003c 1 or not isinstance(max_count, int):"},{"line_number":449,"context_line":"            print(_(\u0027Must supply a positive value for max_number\u0027))"},{"line_number":450,"context_line":"            return MIGRATION_ERROR_CODE"},{"line_number":451,"context_line":"    else:"}],"source_content_type":"text/x-python","patch_set":3,"id":"1f013ff3_300309bb","line":448,"range":{"start_line":448,"start_character":11,"end_line":448,"end_character":59},"updated":"2017-05-16 18:37:47.000000000","message":"max_count is None or max_count \u003c 1:\n\nor \n\nnot max_count or max_count \u003c 1:","commit_id":"cc97e9e7e4bf12ebfddc1ae77cb4ea00b150a373"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"711ed96b44baf93b892c4671b7aba69ca5d58884","unresolved":false,"context_lines":[{"line_number":445,"context_line":"    if CONF.command.max_count is not None:"},{"line_number":446,"context_line":"        max_count \u003d CONF.command.max_count"},{"line_number":447,"context_line":"        unlimited \u003d False"},{"line_number":448,"context_line":"        if max_count \u003c 1 or not isinstance(max_count, int):"},{"line_number":449,"context_line":"            print(_(\u0027Must supply a positive value for max_number\u0027))"},{"line_number":450,"context_line":"            return MIGRATION_ERROR_CODE"},{"line_number":451,"context_line":"    else:"}],"source_content_type":"text/x-python","patch_set":3,"id":"1f013ff3_ab6d6c05","line":448,"range":{"start_line":448,"start_character":11,"end_line":448,"end_character":59},"in_reply_to":"1f013ff3_300309bb","updated":"2017-06-03 00:53:05.000000000","message":"Done","commit_id":"cc97e9e7e4bf12ebfddc1ae77cb4ea00b150a373"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"c26f52c5c29003bbf66f32092b0c595706d8d110","unresolved":false,"context_lines":[{"line_number":656,"context_line":"def _run_migration(ctxt, max_count):"},{"line_number":657,"context_line":"    total_migrations_ran \u003d 0"},{"line_number":658,"context_line":"    migrations \u003d {}"},{"line_number":659,"context_line":"    for migration_recipie in ONLINE_MIGRATIONS:"},{"line_number":660,"context_line":"        count \u003d max_count - total_migrations_ran"},{"line_number":661,"context_line":"        try:"},{"line_number":662,"context_line":"            found, done \u003d migration_recipie(ctxt, count)"}],"source_content_type":"text/x-python","patch_set":3,"id":"1f013ff3_f0bc81dd","line":659,"range":{"start_line":659,"start_character":18,"end_line":659,"end_character":25},"updated":"2017-05-16 18:37:47.000000000","message":"recipe","commit_id":"cc97e9e7e4bf12ebfddc1ae77cb4ea00b150a373"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"711ed96b44baf93b892c4671b7aba69ca5d58884","unresolved":false,"context_lines":[{"line_number":656,"context_line":"def _run_migration(ctxt, max_count):"},{"line_number":657,"context_line":"    total_migrations_ran \u003d 0"},{"line_number":658,"context_line":"    migrations \u003d {}"},{"line_number":659,"context_line":"    for migration_recipie in ONLINE_MIGRATIONS:"},{"line_number":660,"context_line":"        count \u003d max_count - total_migrations_ran"},{"line_number":661,"context_line":"        try:"},{"line_number":662,"context_line":"            found, done \u003d migration_recipie(ctxt, count)"}],"source_content_type":"text/x-python","patch_set":3,"id":"1f013ff3_eb637419","line":659,"range":{"start_line":659,"start_character":18,"end_line":659,"end_character":25},"in_reply_to":"1f013ff3_f0bc81dd","updated":"2017-06-03 00:53:05.000000000","message":"Done","commit_id":"cc97e9e7e4bf12ebfddc1ae77cb4ea00b150a373"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"c26f52c5c29003bbf66f32092b0c595706d8d110","unresolved":false,"context_lines":[{"line_number":661,"context_line":"        try:"},{"line_number":662,"context_line":"            found, done \u003d migration_recipie(ctxt, count)"},{"line_number":663,"context_line":"        except Exception:"},{"line_number":664,"context_line":"            LOG.exception(_LE(\u0027 Failed to run %(migration)s migration.\u0027),"},{"line_number":665,"context_line":"                          migration_recipie)"},{"line_number":666,"context_line":"            found \u003d done \u003d 0"},{"line_number":667,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"1f013ff3_30f1c9ce","line":664,"range":{"start_line":664,"start_character":26,"end_line":664,"end_character":30},"updated":"2017-05-16 18:37:47.000000000","message":"we don\u0027t translate log messages anymore","commit_id":"cc97e9e7e4bf12ebfddc1ae77cb4ea00b150a373"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"711ed96b44baf93b892c4671b7aba69ca5d58884","unresolved":false,"context_lines":[{"line_number":661,"context_line":"        try:"},{"line_number":662,"context_line":"            found, done \u003d migration_recipie(ctxt, count)"},{"line_number":663,"context_line":"        except Exception:"},{"line_number":664,"context_line":"            LOG.exception(_LE(\u0027 Failed to run %(migration)s migration.\u0027),"},{"line_number":665,"context_line":"                          migration_recipie)"},{"line_number":666,"context_line":"            found \u003d done \u003d 0"},{"line_number":667,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"1f013ff3_cb66782a","line":664,"range":{"start_line":664,"start_character":26,"end_line":664,"end_character":30},"in_reply_to":"1f013ff3_30f1c9ce","updated":"2017-06-03 00:53:05.000000000","message":"Done","commit_id":"cc97e9e7e4bf12ebfddc1ae77cb4ea00b150a373"}]}
