)]}'
{"doc/source/man/glancemanage.rst":[{"author":{"_account_id":22448,"name":"Alexander Bashmakov","email":"abashmak@yahoo.com","username":"abashmak"},"change_message_id":"2fb965014eb9e54e5f0d4f2b58f3a2599edca55d","unresolved":false,"context_lines":[{"line_number":57,"context_line":"        Place an existing database under migration control and upgrade it to"},{"line_number":58,"context_line":"        the specified VERSION."},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"  **db_export_metadefs**"},{"line_number":61,"context_line":"        Export the metadata definitions into json format. By default the"},{"line_number":62,"context_line":"        definitions are exported to /etc/glance/metadefs directory."},{"line_number":63,"context_line":""}],"source_content_type":"text/x-rst","patch_set":17,"id":"7a77a97e_6e2de5a6","line":60,"updated":"2016-11-15 16:46:37.000000000","message":"Why was the [PATH | PREFIX] arg removed?","commit_id":"62824326dce0af2af280700f8f6b5920e1015a31"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"7f668b0dea332e1c25a3f16f310f66373ec4b5fb","unresolved":false,"context_lines":[{"line_number":57,"context_line":"        Place an existing database under migration control and upgrade it to"},{"line_number":58,"context_line":"        the specified VERSION."},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"  **db_export_metadefs**"},{"line_number":61,"context_line":"        Export the metadata definitions into json format. By default the"},{"line_number":62,"context_line":"        definitions are exported to /etc/glance/metadefs directory."},{"line_number":63,"context_line":""}],"source_content_type":"text/x-rst","patch_set":17,"id":"7a77a97e_51e8cc10","line":60,"in_reply_to":"7a77a97e_6e2de5a6","updated":"2016-11-15 16:50:06.000000000","message":"Those changes are not a part of this patch. Those appear only when you compare the patchsets.","commit_id":"62824326dce0af2af280700f8f6b5920e1015a31"},{"author":{"_account_id":22448,"name":"Alexander Bashmakov","email":"abashmak@yahoo.com","username":"abashmak"},"change_message_id":"2fb965014eb9e54e5f0d4f2b58f3a2599edca55d","unresolved":false,"context_lines":[{"line_number":61,"context_line":"        Export the metadata definitions into json format. By default the"},{"line_number":62,"context_line":"        definitions are exported to /etc/glance/metadefs directory."},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"  **db_load_metadefs**"},{"line_number":65,"context_line":"        Load the metadata definitions into glance database. By default the"},{"line_number":66,"context_line":"        definitions are imported from /etc/glance/metadefs directory."},{"line_number":67,"context_line":""}],"source_content_type":"text/x-rst","patch_set":17,"id":"7a77a97e_ee17354f","line":64,"updated":"2016-11-15 16:46:37.000000000","message":"ditto [PATH] arg","commit_id":"62824326dce0af2af280700f8f6b5920e1015a31"}],"glance/cmd/manage.py":[{"author":{"_account_id":22448,"name":"Alexander Bashmakov","email":"abashmak@yahoo.com","username":"abashmak"},"change_message_id":"e8062249de0680f01fbae93c7121ed1af39829a2","unresolved":false,"context_lines":[{"line_number":115,"context_line":"    def _place_database_under_alembic_control(self):"},{"line_number":116,"context_line":"        a_config \u003d self._get_alembic_config()"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"        if not self._is_database_alembicized():"},{"line_number":119,"context_line":"            print(_(\"Database is currently not under Alembic\u0027s migration \""},{"line_number":120,"context_line":"                    \"control.\"))"},{"line_number":121,"context_line":"            head \u003d self._get_current_legacy_head()"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a95cdbc_d2365fe6","line":118,"range":{"start_line":118,"start_character":20,"end_line":118,"end_character":46},"updated":"2016-10-06 16:13:44.000000000","message":"Not defined anywhere.","commit_id":"bc0eba5b1669a71f1f0bdd64d264d9536f789c9c"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"28c5effdce68ed76f301c7624dd283a8acabda76","unresolved":false,"context_lines":[{"line_number":115,"context_line":"    def _place_database_under_alembic_control(self):"},{"line_number":116,"context_line":"        a_config \u003d self._get_alembic_config()"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"        if not self._is_database_alembicized():"},{"line_number":119,"context_line":"            print(_(\"Database is currently not under Alembic\u0027s migration \""},{"line_number":120,"context_line":"                    \"control.\"))"},{"line_number":121,"context_line":"            head \u003d self._get_current_legacy_head()"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a95cdbc_f2aefb83","line":118,"range":{"start_line":118,"start_character":20,"end_line":118,"end_character":46},"in_reply_to":"1a95cdbc_d2365fe6","updated":"2016-10-06 16:17:34.000000000","message":"oops, fixed it.\nThanks","commit_id":"bc0eba5b1669a71f1f0bdd64d264d9536f789c9c"},{"author":{"_account_id":12807,"name":"Steve Lewis (stevelle)","email":"stevelle@gmail.com","username":"stevelle"},"change_message_id":"94f2bc6e76f1e5dea09e25b564602973f50324b0","unresolved":false,"context_lines":[{"line_number":76,"context_line":"    def __init__(self):"},{"line_number":77,"context_line":"        pass"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    def _get_alembic_config(self):"},{"line_number":80,"context_line":"        \"\"\"Return a valid alembic config object\"\"\""},{"line_number":81,"context_line":"        # TODO(abashmak) there has to be a better way to do this"},{"line_number":82,"context_line":"        ini \u003d \u0027../db/sqlalchemy/alembic_migrations/alembic.ini\u0027"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba5da102_33b458f1","line":79,"updated":"2016-10-26 22:59:03.000000000","message":"I would recommend that this func be moved to db/sqlalchemy/alembic_migrations/__init__.py to address the TODO\n\nThis will keep the path details inside that module and eliminate one of the imports you wouldn\u0027t otherwise need.\n\nI provide a comment in that file with an example of what I was thinking as a suggestion.","commit_id":"20edb12c0776da290b76317f247ba2bb09617681"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"65a52c00cea27f67f9c904fb69da781add4c40f8","unresolved":false,"context_lines":[{"line_number":76,"context_line":"    def __init__(self):"},{"line_number":77,"context_line":"        pass"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    def _get_alembic_config(self):"},{"line_number":80,"context_line":"        \"\"\"Return a valid alembic config object\"\"\""},{"line_number":81,"context_line":"        # TODO(abashmak) there has to be a better way to do this"},{"line_number":82,"context_line":"        ini \u003d \u0027../db/sqlalchemy/alembic_migrations/alembic.ini\u0027"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba5da102_25b6b5dc","line":79,"in_reply_to":"ba5da102_33b458f1","updated":"2016-10-27 19:01:34.000000000","message":"Done\n\nI moved all the alembic helper menthods here into db/sqlalchemy/alembic_migrations/__init__.py","commit_id":"20edb12c0776da290b76317f247ba2bb09617681"},{"author":{"_account_id":12807,"name":"Steve Lewis (stevelle)","email":"stevelle@gmail.com","username":"stevelle"},"change_message_id":"94f2bc6e76f1e5dea09e25b564602973f50324b0","unresolved":false,"context_lines":[{"line_number":89,"context_line":"    def _get_current_alembic_heads(self):"},{"line_number":90,"context_line":"        \"\"\"Return current heads (if any) from the alembic migration table\"\"\""},{"line_number":91,"context_line":"        engine \u003d db_api.get_engine()"},{"line_number":92,"context_line":"        conn \u003d engine.connect()"},{"line_number":93,"context_line":"        context \u003d alembic_migration.MigrationContext.configure(conn)"},{"line_number":94,"context_line":"        return context.get_current_heads()"},{"line_number":95,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"ba5da102_df815d4f","line":92,"updated":"2016-10-26 22:59:03.000000000","message":"I believe this connection should be closed after the current heads are collected.\n \nhttp://docs.sqlalchemy.org/en/latest/core/connections.html#sqlalchemy.engine.Connection","commit_id":"20edb12c0776da290b76317f247ba2bb09617681"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"65a52c00cea27f67f9c904fb69da781add4c40f8","unresolved":false,"context_lines":[{"line_number":89,"context_line":"    def _get_current_alembic_heads(self):"},{"line_number":90,"context_line":"        \"\"\"Return current heads (if any) from the alembic migration table\"\"\""},{"line_number":91,"context_line":"        engine \u003d db_api.get_engine()"},{"line_number":92,"context_line":"        conn \u003d engine.connect()"},{"line_number":93,"context_line":"        context \u003d alembic_migration.MigrationContext.configure(conn)"},{"line_number":94,"context_line":"        return context.get_current_heads()"},{"line_number":95,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"ba5da102_65350d45","line":92,"in_reply_to":"ba5da102_df815d4f","updated":"2016-10-27 19:01:34.000000000","message":"Done","commit_id":"20edb12c0776da290b76317f247ba2bb09617681"},{"author":{"_account_id":12807,"name":"Steve Lewis (stevelle)","email":"stevelle@gmail.com","username":"stevelle"},"change_message_id":"94f2bc6e76f1e5dea09e25b564602973f50324b0","unresolved":false,"context_lines":[{"line_number":90,"context_line":"        \"\"\"Return current heads (if any) from the alembic migration table\"\"\""},{"line_number":91,"context_line":"        engine \u003d db_api.get_engine()"},{"line_number":92,"context_line":"        conn \u003d engine.connect()"},{"line_number":93,"context_line":"        context \u003d alembic_migration.MigrationContext.configure(conn)"},{"line_number":94,"context_line":"        return context.get_current_heads()"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"    def _get_current_legacy_head(self):"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba5da102_dfe87d19","line":93,"updated":"2016-10-26 22:59:03.000000000","message":"I might suggest moving this to a helper func in db/sqlalchemy/alembic_migrations/__init__.py as well so that you eliminate another alembic import polluting the manage space. \n\nThat could mean moving the entire _get_current_alembic_heads function or just having the context retrieval move.","commit_id":"20edb12c0776da290b76317f247ba2bb09617681"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"65a52c00cea27f67f9c904fb69da781add4c40f8","unresolved":false,"context_lines":[{"line_number":90,"context_line":"        \"\"\"Return current heads (if any) from the alembic migration table\"\"\""},{"line_number":91,"context_line":"        engine \u003d db_api.get_engine()"},{"line_number":92,"context_line":"        conn \u003d engine.connect()"},{"line_number":93,"context_line":"        context \u003d alembic_migration.MigrationContext.configure(conn)"},{"line_number":94,"context_line":"        return context.get_current_heads()"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"    def _get_current_legacy_head(self):"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba5da102_e5203dfa","line":93,"in_reply_to":"ba5da102_dfe87d19","updated":"2016-10-27 19:01:34.000000000","message":"Done","commit_id":"20edb12c0776da290b76317f247ba2bb09617681"},{"author":{"_account_id":12807,"name":"Steve Lewis (stevelle)","email":"stevelle@gmail.com","username":"stevelle"},"change_message_id":"94f2bc6e76f1e5dea09e25b564602973f50324b0","unresolved":false,"context_lines":[{"line_number":107,"context_line":"            return True"},{"line_number":108,"context_line":"        return False"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"    def _is_database_under_migrate_control(self):"},{"line_number":111,"context_line":"        if self._get_current_legacy_head() in range(1, 45):"},{"line_number":112,"context_line":"            return True"},{"line_number":113,"context_line":"        return False"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba5da102_b3c4e840","line":110,"updated":"2016-10-26 22:59:03.000000000","message":"Is this method name accurate? it doesn\u0027t seem to be because control seems to imply exclusivity and the implementation of this method does not explicitly enforce exclusivity. It seems like this tests whether the legacy migrate head is at the final legacy migration, so:\n\n  _is_database_at_migrate_control_terminus()\n\nseems more accurate.","commit_id":"20edb12c0776da290b76317f247ba2bb09617681"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"65a52c00cea27f67f9c904fb69da781add4c40f8","unresolved":false,"context_lines":[{"line_number":107,"context_line":"            return True"},{"line_number":108,"context_line":"        return False"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"    def _is_database_under_migrate_control(self):"},{"line_number":111,"context_line":"        if self._get_current_legacy_head() in range(1, 45):"},{"line_number":112,"context_line":"            return True"},{"line_number":113,"context_line":"        return False"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba5da102_ca86e8b8","line":110,"in_reply_to":"ba5da102_b3c4e840","updated":"2016-10-27 19:01:34.000000000","message":"As of now, the glance database can be controlled both by sqlalchemy-migrate and alembic. They aren\u0027t mutually exclusive yet, which is why we are just checking whether the database in under migrate\u0027s control by means of fetching the migrate version. The migrate version need not necessarily be at the head/latest version.","commit_id":"20edb12c0776da290b76317f247ba2bb09617681"},{"author":{"_account_id":22448,"name":"Alexander Bashmakov","email":"abashmak@yahoo.com","username":"abashmak"},"change_message_id":"b55101c1eed84a6635eb407446dceb53f2e816c8","unresolved":false,"context_lines":[{"line_number":173,"context_line":"            self._place_database_under_alembic_control()"},{"line_number":174,"context_line":""},{"line_number":175,"context_line":"        a_config \u003d self._get_alembic_config()"},{"line_number":176,"context_line":"        if version is None:"},{"line_number":177,"context_line":"            version \u003d \u0027heads\u0027"},{"line_number":178,"context_line":"        alembic_command.upgrade(a_config, version)"},{"line_number":179,"context_line":"        print(_(\"Upgraded database to revision:\"), version)"}],"source_content_type":"text/x-python","patch_set":4,"id":"1a95cdbc_a0dfb067","line":176,"range":{"start_line":176,"start_character":0,"end_line":176,"end_character":27},"updated":"2016-10-06 20:39:22.000000000","message":"Need the same check in version_control above, otherwise it fails with legacy command.","commit_id":"20edb12c0776da290b76317f247ba2bb09617681"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"65a52c00cea27f67f9c904fb69da781add4c40f8","unresolved":false,"context_lines":[{"line_number":173,"context_line":"            self._place_database_under_alembic_control()"},{"line_number":174,"context_line":""},{"line_number":175,"context_line":"        a_config \u003d self._get_alembic_config()"},{"line_number":176,"context_line":"        if version is None:"},{"line_number":177,"context_line":"            version \u003d \u0027heads\u0027"},{"line_number":178,"context_line":"        alembic_command.upgrade(a_config, version)"},{"line_number":179,"context_line":"        print(_(\"Upgraded database to revision:\"), version)"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba5da102_857221e4","line":176,"range":{"start_line":176,"start_character":0,"end_line":176,"end_character":27},"in_reply_to":"1a95cdbc_a0dfb067","updated":"2016-10-27 19:01:34.000000000","message":"Done","commit_id":"20edb12c0776da290b76317f247ba2bb09617681"},{"author":{"_account_id":22448,"name":"Alexander Bashmakov","email":"abashmak@yahoo.com","username":"abashmak"},"change_message_id":"3e9869fbaa101ef7effb434e9d7b547a7a0df74e","unresolved":false,"context_lines":[{"line_number":110,"context_line":"        Place an existing database under migration control and upgrade it."},{"line_number":111,"context_line":"        \"\"\""},{"line_number":112,"context_line":"        if (alembic_migrations.is_database_under_migrate_control() and"},{"line_number":113,"context_line":"                not alembic_migrations.is_database_under_alembic_control()):"},{"line_number":114,"context_line":"            alembic_migrations.place_database_under_alembic_control()"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"        a_config \u003d alembic_migrations.get_alembic_config()"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba5da102_a6f3ac72","line":113,"range":{"start_line":113,"start_character":16,"end_line":113,"end_character":75},"updated":"2016-10-27 19:28:33.000000000","message":"no need for this, place_database_under_alembic_control already has the check.\n\nIn fact, I\u0027m wondering why check for legacy migrate control either?","commit_id":"b55ac7d9f44a06aeb0291d206e2a837e86354bd1"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"9d2609da2364918c0b7d18755b48f98f8d636d93","unresolved":false,"context_lines":[{"line_number":110,"context_line":"        Place an existing database under migration control and upgrade it."},{"line_number":111,"context_line":"        \"\"\""},{"line_number":112,"context_line":"        if (alembic_migrations.is_database_under_migrate_control() and"},{"line_number":113,"context_line":"                not alembic_migrations.is_database_under_alembic_control()):"},{"line_number":114,"context_line":"            alembic_migrations.place_database_under_alembic_control()"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"        a_config \u003d alembic_migrations.get_alembic_config()"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba5da102_e649248d","line":113,"range":{"start_line":113,"start_character":16,"end_line":113,"end_character":75},"in_reply_to":"ba5da102_a6f3ac72","updated":"2016-10-27 19:41:17.000000000","message":"Yeah, we should probably remove the check from  place_database_under_alembic_control. The reason I say that is having explicit checks is easier to understand than checking it inside the method. It is for the same reason I\u0027d like to retain the other check as well. \n\nThis piece of code isn\u0027t something we\u0027d retaining forever. I\u0027d guess that as soon as we drop support of migrate, we don\u0027t need this bit of code. So, until then I thin it is better to leave the explicit conditions like this.\n\nWhat do you think?","commit_id":"b55ac7d9f44a06aeb0291d206e2a837e86354bd1"},{"author":{"_account_id":22448,"name":"Alexander Bashmakov","email":"abashmak@yahoo.com","username":"abashmak"},"change_message_id":"3be6a4bb5ff9ae51cb5c5b0060934ee6a78dfa2c","unresolved":false,"context_lines":[{"line_number":110,"context_line":"        Place an existing database under migration control and upgrade it."},{"line_number":111,"context_line":"        \"\"\""},{"line_number":112,"context_line":"        if (alembic_migrations.is_database_under_migrate_control() and"},{"line_number":113,"context_line":"                not alembic_migrations.is_database_under_alembic_control()):"},{"line_number":114,"context_line":"            alembic_migrations.place_database_under_alembic_control()"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"        a_config \u003d alembic_migrations.get_alembic_config()"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba5da102_86186886","line":113,"range":{"start_line":113,"start_character":16,"end_line":113,"end_character":75},"in_reply_to":"ba5da102_e649248d","updated":"2016-10-27 19:47:48.000000000","message":"I\u0027m fine with keeping these checks here for now, if we\u0027re going to remove them later. Perhaps add a TODO or NOTE to that effect?\n\nI think the check inside \"place_db_under_alembic_control\" actually needs to stay for efficiency reasons.","commit_id":"b55ac7d9f44a06aeb0291d206e2a837e86354bd1"},{"author":{"_account_id":22448,"name":"Alexander Bashmakov","email":"abashmak@yahoo.com","username":"abashmak"},"change_message_id":"3e9869fbaa101ef7effb434e9d7b547a7a0df74e","unresolved":false,"context_lines":[{"line_number":115,"context_line":""},{"line_number":116,"context_line":"        a_config \u003d alembic_migrations.get_alembic_config()"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"        if version is None:"},{"line_number":119,"context_line":"            version \u003d \u0027heads\u0027"},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"        alembic_command.upgrade(a_config, version)"},{"line_number":122,"context_line":"        print(_(\"Upgraded database to revision:\"), version)"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba5da102_46fd7039","line":119,"range":{"start_line":118,"start_character":0,"end_line":119,"end_character":29},"updated":"2016-10-27 19:28:33.000000000","message":"nit: move this to line 112 for better clarity?","commit_id":"b55ac7d9f44a06aeb0291d206e2a837e86354bd1"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"9d2609da2364918c0b7d18755b48f98f8d636d93","unresolved":false,"context_lines":[{"line_number":115,"context_line":""},{"line_number":116,"context_line":"        a_config \u003d alembic_migrations.get_alembic_config()"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"        if version is None:"},{"line_number":119,"context_line":"            version \u003d \u0027heads\u0027"},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"        alembic_command.upgrade(a_config, version)"},{"line_number":122,"context_line":"        print(_(\"Upgraded database to revision:\"), version)"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba5da102_469490e1","line":119,"range":{"start_line":118,"start_character":0,"end_line":119,"end_character":29},"in_reply_to":"ba5da102_46fd7039","updated":"2016-10-27 19:41:17.000000000","message":"Done","commit_id":"b55ac7d9f44a06aeb0291d206e2a837e86354bd1"},{"author":{"_account_id":12807,"name":"Steve Lewis (stevelle)","email":"stevelle@gmail.com","username":"stevelle"},"change_message_id":"e48a7a593c04551c9b29c508196723ffb09a3fa2","unresolved":false,"context_lines":[{"line_number":82,"context_line":"                print(head)"},{"line_number":83,"context_line":"        else:"},{"line_number":84,"context_line":"            # Migrations are managed by legacy versioning scheme"},{"line_number":85,"context_line":"            print(_(\u0027Database is either not under migration control or under \u0027"},{"line_number":86,"context_line":"                    \u0027legacy migration control, please run \u0027"},{"line_number":87,"context_line":"                    \u0027\"glance-manage db sync\" to place the database under \u0027"},{"line_number":88,"context_line":"                    \u0027alembic migration control.\u0027))"}],"source_content_type":"text/x-python","patch_set":6,"id":"ba5da102_494f43bd","line":85,"updated":"2016-10-27 22:42:46.000000000","message":"I\u0027m wondering if this should go to stderr instead of stdout? Maybe also returning a non-zero exit code? Programmatic execution of the manage tool should be the expectation (including scripts and config mgmt tools), so let\u0027s make it easier to use that way.\n\nThis implies potential other changes below as well.","commit_id":"f2aea2a9f535c75bd77fc13e1eb1478a96f0bc13"},{"author":{"_account_id":12807,"name":"Steve Lewis (stevelle)","email":"stevelle@gmail.com","username":"stevelle"},"change_message_id":"e48a7a593c04551c9b29c508196723ffb09a3fa2","unresolved":false,"context_lines":[{"line_number":104,"context_line":"        print(_(\"Placed database under migration control at \""},{"line_number":105,"context_line":"                \"revision:\"), version)"},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"    @args(\u0027--version\u0027, metavar\u003d\u0027\u003cversion\u003e\u0027, help\u003d\u0027Database version\u0027)"},{"line_number":108,"context_line":"    def sync(self, version\u003d\u0027heads\u0027):"},{"line_number":109,"context_line":"        \"\"\""},{"line_number":110,"context_line":"        Place an existing database under migration control and upgrade it."}],"source_content_type":"text/x-python","patch_set":6,"id":"ba5da102_497823f3","line":107,"updated":"2016-10-27 22:42:46.000000000","message":"This metavar is a target version. The help text could be clearer / more helpful. Repeat for each occurrence above.","commit_id":"f2aea2a9f535c75bd77fc13e1eb1478a96f0bc13"},{"author":{"_account_id":22448,"name":"Alexander Bashmakov","email":"abashmak@yahoo.com","username":"abashmak"},"change_message_id":"f75d3d829ff7bcca6e36cfd85b2520b1c19d99ab","unresolved":false,"context_lines":[{"line_number":104,"context_line":"        print(_(\"Placed database under migration control at \""},{"line_number":105,"context_line":"                \"revision:\"), version)"},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"    @args(\u0027--version\u0027, metavar\u003d\u0027\u003cversion\u003e\u0027, help\u003d\u0027Database version\u0027)"},{"line_number":108,"context_line":"    def sync(self, version\u003d\u0027heads\u0027):"},{"line_number":109,"context_line":"        \"\"\""},{"line_number":110,"context_line":"        Place an existing database under migration control and upgrade it."}],"source_content_type":"text/x-python","patch_set":6,"id":"ba5da102_accc6d36","line":107,"in_reply_to":"ba5da102_497823f3","updated":"2016-10-27 23:03:43.000000000","message":"That is generally a good idea, but I\u0027m wary of doing that here. There are a number of new changes in this file and adding unrelated changes to existing code will make it more difficult to review. These would be better in a separate patch set aimed at improving help texts.","commit_id":"f2aea2a9f535c75bd77fc13e1eb1478a96f0bc13"},{"author":{"_account_id":22448,"name":"Alexander Bashmakov","email":"abashmak@yahoo.com","username":"abashmak"},"change_message_id":"ffd2cec477ecf52ecc16dbaff70b3bac061fe3fb","unresolved":false,"context_lines":[{"line_number":121,"context_line":""},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"        alembic_command.upgrade(a_config, version)"},{"line_number":124,"context_line":"        print(_(\"Upgraded database to revision:\"), version)"},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"    @args(\u0027--path\u0027, metavar\u003d\u0027\u003cpath\u003e\u0027, help\u003d\u0027Path to the directory or file \u0027"},{"line_number":127,"context_line":"                                           \u0027where json metadata is stored\u0027)"}],"source_content_type":"text/x-python","patch_set":6,"id":"ba5da102_a987ff5f","line":124,"range":{"start_line":124,"start_character":0,"end_line":124,"end_character":59},"updated":"2016-10-27 20:19:00.000000000","message":"In order to consistently communicate version names to the user, suggest replacing line 124 with:\n\nheads \u003d self._get_current_alembic_heads()\nif heads is None:\n    raise Exception(\"Database sync failed\")\nprint(_(\"Upgraded database, current revision(s):\"), \", \".join(heads))","commit_id":"f2aea2a9f535c75bd77fc13e1eb1478a96f0bc13"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"eeb418745e8b89cd393c902553fc753abc00089d","unresolved":false,"context_lines":[{"line_number":119,"context_line":"        a_config \u003d alembic_migrations.get_alembic_config()"},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"        alembic_command.upgrade(a_config, version)"},{"line_number":122,"context_line":"        heads \u003d alembic_migrations.get_current_alembic_heads()"},{"line_number":123,"context_line":"        if heads is None:"},{"line_number":124,"context_line":"            raise Exception(\"Database sync failed\")"},{"line_number":125,"context_line":"        print(_(\"Upgraded database, current revision(s):\"), \", \".join(heads))"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"    @args(\u0027--path\u0027, metavar\u003d\u0027\u003cpath\u003e\u0027, help\u003d\u0027Path to the directory or file \u0027"},{"line_number":128,"context_line":"                                           \u0027where json metadata is stored\u0027)"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba5da102_4fa3b14f","line":125,"range":{"start_line":122,"start_character":0,"end_line":125,"end_character":77},"updated":"2016-10-28 16:21:16.000000000","message":"So, what if I provide an exact version here like \"newton_expand01\"?\nWould printing all the heads be confusing?","commit_id":"65fcf71f7bceed652eada32d072669c2d0ae7c7a"},{"author":{"_account_id":22448,"name":"Alexander Bashmakov","email":"abashmak@yahoo.com","username":"abashmak"},"change_message_id":"b435749a1373e22a442df54c2516c4335e5833b8","unresolved":false,"context_lines":[{"line_number":119,"context_line":"        a_config \u003d alembic_migrations.get_alembic_config()"},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"        alembic_command.upgrade(a_config, version)"},{"line_number":122,"context_line":"        heads \u003d alembic_migrations.get_current_alembic_heads()"},{"line_number":123,"context_line":"        if heads is None:"},{"line_number":124,"context_line":"            raise Exception(\"Database sync failed\")"},{"line_number":125,"context_line":"        print(_(\"Upgraded database, current revision(s):\"), \", \".join(heads))"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"    @args(\u0027--path\u0027, metavar\u003d\u0027\u003cpath\u003e\u0027, help\u003d\u0027Path to the directory or file \u0027"},{"line_number":128,"context_line":"                                           \u0027where json metadata is stored\u0027)"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba5da102_9a9fc54f","line":125,"range":{"start_line":122,"start_character":0,"end_line":125,"end_character":77},"in_reply_to":"ba5da102_4fa3b14f","updated":"2016-10-28 16:41:54.000000000","message":"That\u0027s why I changed the message to say \"upgraded db...\" then comma and print current revision(s).\n\nWe can make it even more explicit: if version is provided, then say: \"upgraded to \u003cversion\u003e, current head revision(s) are: ...\"","commit_id":"65fcf71f7bceed652eada32d072669c2d0ae7c7a"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"560a842bde210e4a0db8d2c40f3ec4dfd7b14248","unresolved":false,"context_lines":[{"line_number":119,"context_line":"        a_config \u003d alembic_migrations.get_alembic_config()"},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"        alembic_command.upgrade(a_config, version)"},{"line_number":122,"context_line":"        heads \u003d alembic_migrations.get_current_alembic_heads()"},{"line_number":123,"context_line":"        if heads is None:"},{"line_number":124,"context_line":"            raise Exception(\"Database sync failed\")"},{"line_number":125,"context_line":"        print(_(\"Upgraded database, current revision(s):\"), \", \".join(heads))"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"    @args(\u0027--path\u0027, metavar\u003d\u0027\u003cpath\u003e\u0027, help\u003d\u0027Path to the directory or file \u0027"},{"line_number":128,"context_line":"                                           \u0027where json metadata is stored\u0027)"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba5da102_d6d2d8d1","line":125,"range":{"start_line":122,"start_character":0,"end_line":125,"end_character":77},"in_reply_to":"ba5da102_9a9fc54f","updated":"2016-10-31 14:53:43.000000000","message":"+1, I like that.","commit_id":"65fcf71f7bceed652eada32d072669c2d0ae7c7a"},{"author":{"_account_id":11642,"name":"Jesse J. Cook","email":"jesse.cook@rackspace.com","username":"crashenx"},"change_message_id":"5282ba4b8708f8ae18aa411d6caba5df8d5e71bf","unresolved":false,"context_lines":[{"line_number":113,"context_line":"            version \u003d \u0027heads\u0027"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"        if (alembic_migrations.is_database_under_migrate_control() and"},{"line_number":116,"context_line":"                not alembic_migrations.is_database_under_alembic_control()):"},{"line_number":117,"context_line":"            alembic_migrations.place_database_under_alembic_control()"},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"        a_config \u003d alembic_migrations.get_alembic_config()"}],"source_content_type":"text/x-python","patch_set":22,"id":"7a3c09a3_8d40e835","line":116,"updated":"2017-01-17 18:01:35.000000000","message":"I\u0027m not sure about this branch:\n\nThe \u0027not alembic_migrations.is_database_under_alembic_control()\u0027 bit doesn\u0027t seem like something you should have to check here and as alembic_migrations.place_database_under_alembic_control() is currently implemented, you in fact do not since it\u0027s appropriately a noop when called. Probably drop it to reduce code complexity.\n\nWhat should happen when the \u0027alembic_migrations.is_database_under_migrate_control()\u0027 bit is false? Should this method carry on? Perhaps I do not fully grok, but does not the rest of this code assume being under alembic control?","commit_id":"b0fcfbce73848117d184ed6957dc5f99d6737cdf"}],"glance/db/sqlalchemy/alembic_migrations/__init__.py":[{"author":{"_account_id":12807,"name":"Steve Lewis (stevelle)","email":"stevelle@gmail.com","username":"stevelle"},"change_message_id":"94f2bc6e76f1e5dea09e25b564602973f50324b0","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"ba5da102_93ac44ef","updated":"2016-10-26 22:59:03.000000000","message":"see comment on manage.py where I recommend something like:\n\ndef config(db_url):\n  module_dir \u003d os.path.abspath(os.path.dirname(__file__))\n  alembic_conf_file \u003d os.path.join(module_dir, \u0027alembic.ini\u0027)\n  config \u003d alembic_config.Config(alembic_conf_file)\n  config.set_main_option(\u0027sqlalchemy.url\u0027, db_url)\n  return config","commit_id":"20edb12c0776da290b76317f247ba2bb09617681"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"65a52c00cea27f67f9c904fb69da781add4c40f8","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"ba5da102_653b4dec","in_reply_to":"ba5da102_93ac44ef","updated":"2016-10-27 19:01:34.000000000","message":"Done","commit_id":"20edb12c0776da290b76317f247ba2bb09617681"},{"author":{"_account_id":22448,"name":"Alexander Bashmakov","email":"abashmak@yahoo.com","username":"abashmak"},"change_message_id":"3e9869fbaa101ef7effb434e9d7b547a7a0df74e","unresolved":false,"context_lines":[{"line_number":71,"context_line":"def place_database_under_alembic_control(self):"},{"line_number":72,"context_line":"    a_config \u003d self._get_alembic_config()"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"    if not self._is_database_under_alembic_control():"},{"line_number":75,"context_line":"        print(_(\"Database is currently not under Alembic\u0027s migration \""},{"line_number":76,"context_line":"                \"control.\"))"},{"line_number":77,"context_line":"        head \u003d self._get_current_legacy_head()"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba5da102_c6d180cf","line":74,"range":{"start_line":74,"start_character":16,"end_line":74,"end_character":50},"updated":"2016-10-27 19:28:33.000000000","message":"bug: s/_is_database_under_alembic_control/is_database_under_alembic_control/","commit_id":"b55ac7d9f44a06aeb0291d206e2a837e86354bd1"},{"author":{"_account_id":12807,"name":"Steve Lewis (stevelle)","email":"stevelle@gmail.com","username":"stevelle"},"change_message_id":"afc83f7200fdb488c8ee91b134588e6e4ada1530","unresolved":false,"context_lines":[{"line_number":39,"context_line":"def get_current_alembic_heads():"},{"line_number":40,"context_line":"    \"\"\"Return current heads (if any) from the alembic migration table\"\"\""},{"line_number":41,"context_line":"    engine \u003d db_api.get_engine()"},{"line_number":42,"context_line":"    conn \u003d engine.connect()"},{"line_number":43,"context_line":"    context \u003d alembic_migration.MigrationContext.configure(conn)"},{"line_number":44,"context_line":"    heads \u003d context.get_current_heads()"},{"line_number":45,"context_line":"    conn.close()"}],"source_content_type":"text/x-python","patch_set":24,"id":"5a3905b3_6a226e03","line":42,"updated":"2017-01-25 20:50:24.000000000","message":"why not use a context manager (\u0027with\u0027 syntax)?","commit_id":"a5143299be1f16ae05072ce5ad2aafaa154d20d1"}],"glance/db/sqlalchemy/alembic_migrations/env.py":[{"author":{"_account_id":12807,"name":"Steve Lewis (stevelle)","email":"stevelle@gmail.com","username":"stevelle"},"change_message_id":"94f2bc6e76f1e5dea09e25b564602973f50324b0","unresolved":false,"context_lines":[{"line_number":22,"context_line":""},{"line_number":23,"context_line":"# this is the Alembic Config object, which provides"},{"line_number":24,"context_line":"# access to the values within the .ini file in use."},{"line_number":25,"context_line":"config \u003d context.config"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"# Interpret the config file for Python logging."},{"line_number":28,"context_line":"# This line sets up loggers basically."}],"source_content_type":"text/x-python","patch_set":4,"id":"ba5da102_ff3b819a","line":25,"updated":"2016-10-26 22:59:03.000000000","message":"This looks like it does the same thing my example implementation for config(db_url) does in __init__.py except simpler because it assumes paths and the location of the .ini file. Maybe apply this to __init__.py for reuse in manage.py instead.","commit_id":"20edb12c0776da290b76317f247ba2bb09617681"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"65a52c00cea27f67f9c904fb69da781add4c40f8","unresolved":false,"context_lines":[{"line_number":22,"context_line":""},{"line_number":23,"context_line":"# this is the Alembic Config object, which provides"},{"line_number":24,"context_line":"# access to the values within the .ini file in use."},{"line_number":25,"context_line":"config \u003d context.config"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"# Interpret the config file for Python logging."},{"line_number":28,"context_line":"# This line sets up loggers basically."}],"source_content_type":"text/x-python","patch_set":4,"id":"ba5da102_66743435","line":25,"in_reply_to":"ba5da102_ff3b819a","updated":"2016-10-27 19:01:34.000000000","message":"I don\u0027t think we use this. At this point we don\u0027t have the sqlalchemy.url set. We set it after explicitly creating config, which is then used to create an EnvironmentContext for invoking Alembic. Once Alembic is invoked, it uses this EnvironmentContext.\n\nLet me know if I misunderstood you.","commit_id":"20edb12c0776da290b76317f247ba2bb09617681"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"fa0660ae0289e7720b9594638fcc9fa603416a39","unresolved":false,"context_lines":[{"line_number":33,"context_line":"# add your model\u0027s MetaData object here"},{"line_number":34,"context_line":"# for \u0027autogenerate\u0027 support"},{"line_number":35,"context_line":"target_metadata \u003d models.BASE.metadata"},{"line_number":36,"context_line":"for table in models_glare.BASE.metadata.sorted_tables:"},{"line_number":37,"context_line":"    target_metadata._add_table(table.name, table.schema, table)"},{"line_number":38,"context_line":"for table in models_metadef.BASE_DICT.metadata.sorted_tables:"},{"line_number":39,"context_line":"    target_metadata._add_table(table.name, table.schema, table)"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"# other values from the config, defined by the needs of env.py,"},{"line_number":42,"context_line":"# can be acquired:"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba5da102_2fe91d81","line":39,"range":{"start_line":36,"start_character":0,"end_line":39,"end_character":63},"updated":"2016-10-28 16:19:04.000000000","message":"oops, my bad.\nThanks for fixing this, Alex!","commit_id":"65fcf71f7bceed652eada32d072669c2d0ae7c7a"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"9b67b0b84b24c6adb6171fb4bc79380a8a628cc1","unresolved":false,"context_lines":[{"line_number":13,"context_line":"#    License for the specific language governing permissions and limitations"},{"line_number":14,"context_line":"#    under the License."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"from __future__ import with_statement"},{"line_number":17,"context_line":"from alembic import context"},{"line_number":18,"context_line":"from sqlalchemy import engine_from_config, pool"},{"line_number":19,"context_line":"from logging.config import fileConfig"}],"source_content_type":"text/x-python","patch_set":18,"id":"1a6eadb0_eaa253fb","line":16,"range":{"start_line":16,"start_character":0,"end_line":16,"end_character":37},"updated":"2016-12-15 11:05:50.000000000","message":"this should not be a part of 3rd party import group","commit_id":"57a4a48b76aa5ebc5e3c1fbf7982ef3b1b43c3d6"},{"author":{"_account_id":22448,"name":"Alexander Bashmakov","email":"abashmak@yahoo.com","username":"abashmak"},"change_message_id":"5c870d8b7e73a446ed93e85fc8ce579e5b2a3ef9","unresolved":false,"context_lines":[{"line_number":13,"context_line":"#    License for the specific language governing permissions and limitations"},{"line_number":14,"context_line":"#    under the License."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"from __future__ import with_statement"},{"line_number":17,"context_line":"from alembic import context"},{"line_number":18,"context_line":"from sqlalchemy import engine_from_config, pool"},{"line_number":19,"context_line":"from logging.config import fileConfig"}],"source_content_type":"text/x-python","patch_set":18,"id":"1a6eadb0_441fb307","line":16,"range":{"start_line":16,"start_character":0,"end_line":16,"end_character":37},"in_reply_to":"1a6eadb0_eaa253fb","updated":"2016-12-15 14:18:19.000000000","message":"Done","commit_id":"57a4a48b76aa5ebc5e3c1fbf7982ef3b1b43c3d6"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"9b67b0b84b24c6adb6171fb4bc79380a8a628cc1","unresolved":false,"context_lines":[{"line_number":16,"context_line":"from __future__ import with_statement"},{"line_number":17,"context_line":"from alembic import context"},{"line_number":18,"context_line":"from sqlalchemy import engine_from_config, pool"},{"line_number":19,"context_line":"from logging.config import fileConfig"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"from glance.db.sqlalchemy import models"},{"line_number":22,"context_line":"from glance.db.sqlalchemy import models_glare"}],"source_content_type":"text/x-python","patch_set":18,"id":"1a6eadb0_6a8e437a","line":19,"range":{"start_line":19,"start_character":0,"end_line":19,"end_character":37},"updated":"2016-12-15 11:05:50.000000000","message":"ditto","commit_id":"57a4a48b76aa5ebc5e3c1fbf7982ef3b1b43c3d6"},{"author":{"_account_id":22448,"name":"Alexander Bashmakov","email":"abashmak@yahoo.com","username":"abashmak"},"change_message_id":"5c870d8b7e73a446ed93e85fc8ce579e5b2a3ef9","unresolved":false,"context_lines":[{"line_number":16,"context_line":"from __future__ import with_statement"},{"line_number":17,"context_line":"from alembic import context"},{"line_number":18,"context_line":"from sqlalchemy import engine_from_config, pool"},{"line_number":19,"context_line":"from logging.config import fileConfig"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"from glance.db.sqlalchemy import models"},{"line_number":22,"context_line":"from glance.db.sqlalchemy import models_glare"}],"source_content_type":"text/x-python","patch_set":18,"id":"1a6eadb0_64182f1f","line":19,"range":{"start_line":19,"start_character":0,"end_line":19,"end_character":37},"in_reply_to":"1a6eadb0_6a8e437a","updated":"2016-12-15 14:18:19.000000000","message":"Done","commit_id":"57a4a48b76aa5ebc5e3c1fbf7982ef3b1b43c3d6"}],"glance/db/sqlalchemy/alembic_migrations/versions/ocata01_add_visibility_remove_is_public.py":[{"author":{"_account_id":12807,"name":"Steve Lewis (stevelle)","email":"stevelle@gmail.com","username":"stevelle"},"change_message_id":"e404564e48f9c4ac18a6fbb4aa1276b06a8e1715","unresolved":false,"context_lines":[{"line_number":36,"context_line":"    meta \u003d MetaData(bind\u003dmigrate_engine)"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"    engine_name \u003d migrate_engine.engine.name"},{"line_number":39,"context_line":"    if engine_name \u003d\u003d \u0027sqlite\u0027:"},{"line_number":40,"context_line":"        sql_file \u003d os.path.splitext(__file__)[0]"},{"line_number":41,"context_line":"        sql_file +\u003d \u0027.sql\u0027"},{"line_number":42,"context_line":"        with open(sql_file, \u0027r\u0027) as sqlite_script:"}],"source_content_type":"text/x-python","patch_set":24,"id":"5a3905b3_41031db8","line":39,"updated":"2017-01-23 19:45:18.000000000","message":"the sqlite handling case is a little bit obscure, could use a comment explaining why.","commit_id":"a5143299be1f16ae05072ce5ad2aafaa154d20d1"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"6b66b7204b092c544019325fe74b7e888b3b35ff","unresolved":false,"context_lines":[{"line_number":36,"context_line":"    meta \u003d MetaData(bind\u003dmigrate_engine)"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"    engine_name \u003d migrate_engine.engine.name"},{"line_number":39,"context_line":"    if engine_name \u003d\u003d \u0027sqlite\u0027:"},{"line_number":40,"context_line":"        sql_file \u003d os.path.splitext(__file__)[0]"},{"line_number":41,"context_line":"        sql_file +\u003d \u0027.sql\u0027"},{"line_number":42,"context_line":"        with open(sql_file, \u0027r\u0027) as sqlite_script:"}],"source_content_type":"text/x-python","patch_set":24,"id":"5a3905b3_7477f99f","line":39,"in_reply_to":"5a3905b3_41031db8","updated":"2017-01-23 20:00:26.000000000","message":"+1 will do","commit_id":"a5143299be1f16ae05072ce5ad2aafaa154d20d1"},{"author":{"_account_id":12807,"name":"Steve Lewis (stevelle)","email":"stevelle@gmail.com","username":"stevelle"},"change_message_id":"e404564e48f9c4ac18a6fbb4aa1276b06a8e1715","unresolved":false,"context_lines":[{"line_number":40,"context_line":"        sql_file \u003d os.path.splitext(__file__)[0]"},{"line_number":41,"context_line":"        sql_file +\u003d \u0027.sql\u0027"},{"line_number":42,"context_line":"        with open(sql_file, \u0027r\u0027) as sqlite_script:"},{"line_number":43,"context_line":"            sql \u003d sqlparse.format(sqlite_script.read(), strip_comments\u003dTrue)"},{"line_number":44,"context_line":"            for statement in sqlparse.split(sql):"},{"line_number":45,"context_line":"                op.execute(statement)"},{"line_number":46,"context_line":"        return"}],"source_content_type":"text/x-python","patch_set":24,"id":"5a3905b3_2153716c","line":43,"updated":"2017-01-23 19:45:18.000000000","message":"Why not something like:\n\n  import sqlite3\n  conn \u003d sqlite3.connect(db_file_name)\n  conn.executescript(sqlite_script)","commit_id":"a5143299be1f16ae05072ce5ad2aafaa154d20d1"},{"author":{"_account_id":12807,"name":"Steve Lewis (stevelle)","email":"stevelle@gmail.com","username":"stevelle"},"change_message_id":"c0e70ff3a0a33b049623d89d03acd5b467c72632","unresolved":false,"context_lines":[{"line_number":40,"context_line":"        sql_file \u003d os.path.splitext(__file__)[0]"},{"line_number":41,"context_line":"        sql_file +\u003d \u0027.sql\u0027"},{"line_number":42,"context_line":"        with open(sql_file, \u0027r\u0027) as sqlite_script:"},{"line_number":43,"context_line":"            sql \u003d sqlparse.format(sqlite_script.read(), strip_comments\u003dTrue)"},{"line_number":44,"context_line":"            for statement in sqlparse.split(sql):"},{"line_number":45,"context_line":"                op.execute(statement)"},{"line_number":46,"context_line":"        return"}],"source_content_type":"text/x-python","patch_set":24,"id":"5a3905b3_08ce9262","line":43,"in_reply_to":"5a3905b3_08d21228","updated":"2017-01-23 21:49:58.000000000","message":"ok, I assumed it would have been in global requirements, and this also explains why I haven\u0027t seen sqlparse directly used before.","commit_id":"a5143299be1f16ae05072ce5ad2aafaa154d20d1"},{"author":{"_account_id":12807,"name":"Steve Lewis (stevelle)","email":"stevelle@gmail.com","username":"stevelle"},"change_message_id":"b6bd4be8cafc9214ac6dc029d0c2424535272956","unresolved":false,"context_lines":[{"line_number":40,"context_line":"        sql_file \u003d os.path.splitext(__file__)[0]"},{"line_number":41,"context_line":"        sql_file +\u003d \u0027.sql\u0027"},{"line_number":42,"context_line":"        with open(sql_file, \u0027r\u0027) as sqlite_script:"},{"line_number":43,"context_line":"            sql \u003d sqlparse.format(sqlite_script.read(), strip_comments\u003dTrue)"},{"line_number":44,"context_line":"            for statement in sqlparse.split(sql):"},{"line_number":45,"context_line":"                op.execute(statement)"},{"line_number":46,"context_line":"        return"}],"source_content_type":"text/x-python","patch_set":24,"id":"5a3905b3_e85a26f1","line":43,"in_reply_to":"5a3905b3_0d4304b3","updated":"2017-01-23 21:41:27.000000000","message":"I guess so, but it is already present in global requirements isn\u0027t it? I don\u0027t know sqlparse at all and haven\u0027t come accross it in the rest of openstack yet.","commit_id":"a5143299be1f16ae05072ce5ad2aafaa154d20d1"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"fbdbf087034b3768ddbe998204aed71795afee16","unresolved":false,"context_lines":[{"line_number":40,"context_line":"        sql_file \u003d os.path.splitext(__file__)[0]"},{"line_number":41,"context_line":"        sql_file +\u003d \u0027.sql\u0027"},{"line_number":42,"context_line":"        with open(sql_file, \u0027r\u0027) as sqlite_script:"},{"line_number":43,"context_line":"            sql \u003d sqlparse.format(sqlite_script.read(), strip_comments\u003dTrue)"},{"line_number":44,"context_line":"            for statement in sqlparse.split(sql):"},{"line_number":45,"context_line":"                op.execute(statement)"},{"line_number":46,"context_line":"        return"}],"source_content_type":"text/x-python","patch_set":24,"id":"5a3905b3_0d4304b3","line":43,"in_reply_to":"5a3905b3_2153716c","updated":"2017-01-23 21:24:45.000000000","message":"Also, this means we have to add sqlite3 as dependency, right?\nIt\u0027ll be the same problem. We have to add a new dependency either way. If that\u0027s case I feel adding sqlparse is better. What do you think?","commit_id":"a5143299be1f16ae05072ce5ad2aafaa154d20d1"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"6b66b7204b092c544019325fe74b7e888b3b35ff","unresolved":false,"context_lines":[{"line_number":40,"context_line":"        sql_file \u003d os.path.splitext(__file__)[0]"},{"line_number":41,"context_line":"        sql_file +\u003d \u0027.sql\u0027"},{"line_number":42,"context_line":"        with open(sql_file, \u0027r\u0027) as sqlite_script:"},{"line_number":43,"context_line":"            sql \u003d sqlparse.format(sqlite_script.read(), strip_comments\u003dTrue)"},{"line_number":44,"context_line":"            for statement in sqlparse.split(sql):"},{"line_number":45,"context_line":"                op.execute(statement)"},{"line_number":46,"context_line":"        return"}],"source_content_type":"text/x-python","patch_set":24,"id":"5a3905b3_1494f540","line":43,"in_reply_to":"5a3905b3_2153716c","updated":"2017-01-23 20:00:26.000000000","message":"Maybe, will try that locally.\nThat means we\u0027ll bypass sqlalchemy. It\u0027s probably not a big deal though considering it is just for functional testing.","commit_id":"a5143299be1f16ae05072ce5ad2aafaa154d20d1"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"fcc8924f30fb59884baf520d63d11a8d0afc1c8a","unresolved":false,"context_lines":[{"line_number":40,"context_line":"        sql_file \u003d os.path.splitext(__file__)[0]"},{"line_number":41,"context_line":"        sql_file +\u003d \u0027.sql\u0027"},{"line_number":42,"context_line":"        with open(sql_file, \u0027r\u0027) as sqlite_script:"},{"line_number":43,"context_line":"            sql \u003d sqlparse.format(sqlite_script.read(), strip_comments\u003dTrue)"},{"line_number":44,"context_line":"            for statement in sqlparse.split(sql):"},{"line_number":45,"context_line":"                op.execute(statement)"},{"line_number":46,"context_line":"        return"}],"source_content_type":"text/x-python","patch_set":24,"id":"5a3905b3_08d21228","line":43,"in_reply_to":"5a3905b3_e85a26f1","updated":"2017-01-23 21:45:13.000000000","message":"I don\u0027t see sqlite3 in global requirements.\nsqlalchemy-migrate uses sqlparse btw.","commit_id":"a5143299be1f16ae05072ce5ad2aafaa154d20d1"},{"author":{"_account_id":12807,"name":"Steve Lewis (stevelle)","email":"stevelle@gmail.com","username":"stevelle"},"change_message_id":"7dbe0a4f9738a1a73e05c6e625feccf8ec3e9804","unresolved":false,"context_lines":[{"line_number":64,"context_line":"        not_(images.c.is_public)).execute()"},{"line_number":65,"context_line":"    # NOTE(dharinic): Identify \u0027shared\u0027 images from the above"},{"line_number":66,"context_line":"    images.update().values(visibility\u003d\u0027shared\u0027).where("},{"line_number":67,"context_line":"        images.c.visibility !\u003d \u0027public\u0027 and images.c.id.in_(select("},{"line_number":68,"context_line":"            [image_members.c.image_id]).distinct().where("},{"line_number":69,"context_line":"            not_(image_members.c.deleted)))).execute()"},{"line_number":70,"context_line":""}],"source_content_type":"text/x-python","patch_set":26,"id":"3a461143_7dc391ed","line":67,"updated":"2017-01-29 17:21:16.000000000","message":"looks like an incorrect use of and here. should use and_()","commit_id":"8ef2db05e59f5cdc12f9f16d039cd03120468eaf"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"f249d08ea58505eb2921d9702c4cd49cfc590f13","unresolved":false,"context_lines":[{"line_number":64,"context_line":"        not_(images.c.is_public)).execute()"},{"line_number":65,"context_line":"    # NOTE(dharinic): Identify \u0027shared\u0027 images from the above"},{"line_number":66,"context_line":"    images.update().values(visibility\u003d\u0027shared\u0027).where("},{"line_number":67,"context_line":"        images.c.visibility !\u003d \u0027public\u0027 and images.c.id.in_(select("},{"line_number":68,"context_line":"            [image_members.c.image_id]).distinct().where("},{"line_number":69,"context_line":"            not_(image_members.c.deleted)))).execute()"},{"line_number":70,"context_line":""}],"source_content_type":"text/x-python","patch_set":26,"id":"3a461143_c3e026fd","line":67,"in_reply_to":"3a461143_7dc391ed","updated":"2017-01-29 21:59:44.000000000","message":"Done","commit_id":"8ef2db05e59f5cdc12f9f16d039cd03120468eaf"}]}
