)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"f9cbb121e9069f268ff8c07696b5ded9fe201da7","unresolved":false,"context_lines":[{"line_number":10,"context_line":"dynamic networks in ML2."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Change-Id: I399e1569baae6f24054aac15c4c51a2e44a20e5b"},{"line_number":13,"context_line":"Partially implements: Blueprint ml2-type-driver-refactor"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"1abeadc6_f89c7b11","line":13,"updated":"2014-08-20 20:17:20.000000000","message":"I think you should also add \"Partially implements: ml2-dynamic-segment\"\n\nIt was not clear to me why only one dynamic segment is supported in this change. Reading the BP made it a little clearer, but it would probably be good to beef up that BP to clarify that the initial implementation is geared towards one dynamic segment per network.\n\nWith the current code, what happens when an attempt is made to allocate more than one dynamic segment? You might consider adding unit tests for this.","commit_id":"d18606a72f6b8dd9a3b63b22f736af02121c7f56"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"dda0e543169ea2f117635db794d7792121a675a3","unresolved":false,"context_lines":[{"line_number":10,"context_line":"dynamic networks in ML2."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Change-Id: I399e1569baae6f24054aac15c4c51a2e44a20e5b"},{"line_number":13,"context_line":"Partially implements: Blueprint ml2-type-driver-refactor"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"1abeadc6_290dc737","line":13,"in_reply_to":"1abeadc6_5b972948","updated":"2014-08-20 21:22:50.000000000","message":"Aha, thanks. Everything becomes clear.","commit_id":"d18606a72f6b8dd9a3b63b22f736af02121c7f56"},{"author":{"_account_id":107,"name":"Arvind Somya","email":"arvind.somya@gmail.com","username":"asomya"},"change_message_id":"27a1a0d574ec40a42d83de14704ddcb9c489dbd0","unresolved":false,"context_lines":[{"line_number":10,"context_line":"dynamic networks in ML2."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Change-Id: I399e1569baae6f24054aac15c4c51a2e44a20e5b"},{"line_number":13,"context_line":"Partially implements: Blueprint ml2-type-driver-refactor"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"1abeadc6_5b972948","line":13,"in_reply_to":"1abeadc6_f89c7b11","updated":"2014-08-20 20:35:46.000000000","message":"A network can have multiple dynamic segments, they\u0027re separated by the physical network property. It\u0027s only one dynamic segment per network per physical network.","commit_id":"d18606a72f6b8dd9a3b63b22f736af02121c7f56"},{"author":{"_account_id":1689,"name":"Robert Kukura","email":"rk@theep.net","username":"rkukura"},"change_message_id":"9714193db657f67cda59a58dfd54e7430b077ec5","unresolved":false,"context_lines":[{"line_number":7,"context_line":"ML2 Type Driver refactor part 2"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This commit builds on top of part 1 to introduce support for creating"},{"line_number":10,"context_line":"dynamic networks in ML2."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Change-Id: I399e1569baae6f24054aac15c4c51a2e44a20e5b"},{"line_number":13,"context_line":"Partially implements: Blueprint ml2-type-driver-refactor"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":16,"id":"1abeadc6_89bd0d6b","line":10,"updated":"2014-08-27 18:34:06.000000000","message":"\"dynamic networks\" -\u003e \"dynamic network segments\"","commit_id":"30cc1b4ac4a7f361222176fc53ae082423476ec0"},{"author":{"_account_id":107,"name":"Arvind Somya","email":"arvind.somya@gmail.com","username":"asomya"},"change_message_id":"4cea7a97512bb8091ffd3afb0743b227044441fc","unresolved":false,"context_lines":[{"line_number":7,"context_line":"ML2 Type Driver refactor part 2"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This commit builds on top of part 1 to introduce support for creating"},{"line_number":10,"context_line":"dynamic networks in ML2."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Change-Id: I399e1569baae6f24054aac15c4c51a2e44a20e5b"},{"line_number":13,"context_line":"Partially implements: Blueprint ml2-type-driver-refactor"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":16,"id":"1abeadc6_6cbeffaf","line":10,"in_reply_to":"1abeadc6_89bd0d6b","updated":"2014-08-27 19:04:02.000000000","message":"Done","commit_id":"30cc1b4ac4a7f361222176fc53ae082423476ec0"}],"neutron/db/migration/alembic_migrations/versions/236b90af57ab_ml2_refactor_for_dynamic_segments.py":[{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"3fb7b6d234caea1d76e6c24be37f6462b5b71a89","unresolved":false,"context_lines":[{"line_number":38,"context_line":"        return"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    op.add_column(\u0027ml2_network_segments\u0027,"},{"line_number":41,"context_line":"                  sa.Column(\u0027dynamic_segment\u0027, sa.Boolean(), default\u003dFalse,"},{"line_number":42,"context_line":"                  nullable\u003dFalse))"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"1abeadc6_5283ec03","line":41,"updated":"2014-08-18 21:29:04.000000000","message":"use server_default\u003dsa.sql.false()","commit_id":"58caf8ebf935c8568de6c2bb0722503dc3155529"},{"author":{"_account_id":107,"name":"Arvind Somya","email":"arvind.somya@gmail.com","username":"asomya"},"change_message_id":"3d7fb9e5545e60055b718cd58a8184642d53852c","unresolved":false,"context_lines":[{"line_number":38,"context_line":"        return"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    op.add_column(\u0027ml2_network_segments\u0027,"},{"line_number":41,"context_line":"                  sa.Column(\u0027dynamic_segment\u0027, sa.Boolean(), default\u003dFalse,"},{"line_number":42,"context_line":"                  nullable\u003dFalse))"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"1abeadc6_f22cf8ad","line":41,"in_reply_to":"1abeadc6_5283ec03","updated":"2014-08-18 21:40:58.000000000","message":"Done","commit_id":"58caf8ebf935c8568de6c2bb0722503dc3155529"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"128ca85de52d57b6fb6c960be96e1aceea8c3010","unresolved":false,"context_lines":[{"line_number":27,"context_line":""},{"line_number":28,"context_line":"migration_for_plugins \u003d ["},{"line_number":29,"context_line":"    \u0027neutron.plugins.ml2.plugin.Ml2Plugin\u0027"},{"line_number":30,"context_line":"]"},{"line_number":31,"context_line":"from alembic import op"},{"line_number":32,"context_line":"from neutron.db import migration"},{"line_number":33,"context_line":"import sqlalchemy as sa"}],"source_content_type":"text/x-python","patch_set":3,"id":"1abeadc6_cbe2e29e","line":30,"updated":"2014-08-19 02:43:56.000000000","message":"Remove this list.","commit_id":"ec2c09048f70de8934e9772f5e44b10a35d41619"},{"author":{"_account_id":107,"name":"Arvind Somya","email":"arvind.somya@gmail.com","username":"asomya"},"change_message_id":"0308c3bcbeb66d25f12aff18d4cfdebb9c26c527","unresolved":false,"context_lines":[{"line_number":27,"context_line":""},{"line_number":28,"context_line":"migration_for_plugins \u003d ["},{"line_number":29,"context_line":"    \u0027neutron.plugins.ml2.plugin.Ml2Plugin\u0027"},{"line_number":30,"context_line":"]"},{"line_number":31,"context_line":"from alembic import op"},{"line_number":32,"context_line":"from neutron.db import migration"},{"line_number":33,"context_line":"import sqlalchemy as sa"}],"source_content_type":"text/x-python","patch_set":3,"id":"1abeadc6_7c109ba8","line":30,"in_reply_to":"1abeadc6_cbe2e29e","updated":"2014-08-19 15:03:06.000000000","message":"Done","commit_id":"ec2c09048f70de8934e9772f5e44b10a35d41619"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"128ca85de52d57b6fb6c960be96e1aceea8c3010","unresolved":false,"context_lines":[{"line_number":29,"context_line":"    \u0027neutron.plugins.ml2.plugin.Ml2Plugin\u0027"},{"line_number":30,"context_line":"]"},{"line_number":31,"context_line":"from alembic import op"},{"line_number":32,"context_line":"from neutron.db import migration"},{"line_number":33,"context_line":"import sqlalchemy as sa"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"1abeadc6_ebeebe8a","line":32,"updated":"2014-08-19 02:43:56.000000000","message":"Remove.","commit_id":"ec2c09048f70de8934e9772f5e44b10a35d41619"},{"author":{"_account_id":107,"name":"Arvind Somya","email":"arvind.somya@gmail.com","username":"asomya"},"change_message_id":"0308c3bcbeb66d25f12aff18d4cfdebb9c26c527","unresolved":false,"context_lines":[{"line_number":29,"context_line":"    \u0027neutron.plugins.ml2.plugin.Ml2Plugin\u0027"},{"line_number":30,"context_line":"]"},{"line_number":31,"context_line":"from alembic import op"},{"line_number":32,"context_line":"from neutron.db import migration"},{"line_number":33,"context_line":"import sqlalchemy as sa"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"1abeadc6_bc2153fe","line":32,"in_reply_to":"1abeadc6_ebeebe8a","updated":"2014-08-19 15:03:06.000000000","message":"Done","commit_id":"ec2c09048f70de8934e9772f5e44b10a35d41619"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"128ca85de52d57b6fb6c960be96e1aceea8c3010","unresolved":false,"context_lines":[{"line_number":35,"context_line":""},{"line_number":36,"context_line":"def upgrade(active_plugins\u003dNone, options\u003dNone):"},{"line_number":37,"context_line":"    if not migration.should_run(active_plugins, migration_for_plugins):"},{"line_number":38,"context_line":"        return"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    op.add_column(\u0027ml2_network_segments\u0027,"},{"line_number":41,"context_line":"                  sa.Column(\u0027dynamic_segment\u0027, sa.Boolean(), default\u003dFalse,"}],"source_content_type":"text/x-python","patch_set":3,"id":"1abeadc6_0bf4da59","line":38,"updated":"2014-08-19 02:43:56.000000000","message":"Remove the above two lines.","commit_id":"ec2c09048f70de8934e9772f5e44b10a35d41619"},{"author":{"_account_id":107,"name":"Arvind Somya","email":"arvind.somya@gmail.com","username":"asomya"},"change_message_id":"0308c3bcbeb66d25f12aff18d4cfdebb9c26c527","unresolved":false,"context_lines":[{"line_number":35,"context_line":""},{"line_number":36,"context_line":"def upgrade(active_plugins\u003dNone, options\u003dNone):"},{"line_number":37,"context_line":"    if not migration.should_run(active_plugins, migration_for_plugins):"},{"line_number":38,"context_line":"        return"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    op.add_column(\u0027ml2_network_segments\u0027,"},{"line_number":41,"context_line":"                  sa.Column(\u0027dynamic_segment\u0027, sa.Boolean(), default\u003dFalse,"}],"source_content_type":"text/x-python","patch_set":3,"id":"1abeadc6_fc1bcbc7","line":38,"in_reply_to":"1abeadc6_0bf4da59","updated":"2014-08-19 15:03:06.000000000","message":"Done","commit_id":"ec2c09048f70de8934e9772f5e44b10a35d41619"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"128ca85de52d57b6fb6c960be96e1aceea8c3010","unresolved":false,"context_lines":[{"line_number":44,"context_line":""},{"line_number":45,"context_line":"def downgrade(active_plugins\u003dNone, options\u003dNone):"},{"line_number":46,"context_line":"    if not migration.should_run(active_plugins, migration_for_plugins):"},{"line_number":47,"context_line":"        return"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"    op.drop_column(\u0027ml2_network_segments\u0027, \u0027dynamic_segment\u0027)"}],"source_content_type":"text/x-python","patch_set":3,"id":"1abeadc6_2be99680","line":47,"updated":"2014-08-19 02:43:56.000000000","message":"Remove the above two lines.","commit_id":"ec2c09048f70de8934e9772f5e44b10a35d41619"},{"author":{"_account_id":107,"name":"Arvind Somya","email":"arvind.somya@gmail.com","username":"asomya"},"change_message_id":"0308c3bcbeb66d25f12aff18d4cfdebb9c26c527","unresolved":false,"context_lines":[{"line_number":44,"context_line":""},{"line_number":45,"context_line":"def downgrade(active_plugins\u003dNone, options\u003dNone):"},{"line_number":46,"context_line":"    if not migration.should_run(active_plugins, migration_for_plugins):"},{"line_number":47,"context_line":"        return"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"    op.drop_column(\u0027ml2_network_segments\u0027, \u0027dynamic_segment\u0027)"}],"source_content_type":"text/x-python","patch_set":3,"id":"1abeadc6_1c7a47f1","line":47,"in_reply_to":"1abeadc6_2be99680","updated":"2014-08-19 15:03:06.000000000","message":"Done","commit_id":"ec2c09048f70de8934e9772f5e44b10a35d41619"},{"author":{"_account_id":7249,"name":"Ann Taraday","email":"akamyshnikova@mirantis.com","username":"AKamyshnikova"},"change_message_id":"5366d80a3b379365c11004f5b1e47a25b0dbacaf","unresolved":false,"context_lines":[{"line_number":32,"context_line":"def upgrade(active_plugins\u003dNone, options\u003dNone):"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"    op.add_column(\u0027ml2_network_segments\u0027,"},{"line_number":35,"context_line":"                  sa.Column(\u0027dynamic_segment\u0027, sa.Boolean(), default\u003dFalse,"},{"line_number":36,"context_line":"                  nullable\u003dFalse, server_default\u003dsa.sql.false()))"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"1abeadc6_1e0c84ec","line":35,"updated":"2014-08-22 08:36:34.000000000","message":"\u0027default\u0027 parameter has no meaning in migration. Remove it.","commit_id":"d6b7daafd411069a7e3fe974dba5481ed85a781d"},{"author":{"_account_id":107,"name":"Arvind Somya","email":"arvind.somya@gmail.com","username":"asomya"},"change_message_id":"0777e6b6fa4edd7077b68585714e7e1d19b0211a","unresolved":false,"context_lines":[{"line_number":32,"context_line":"def upgrade(active_plugins\u003dNone, options\u003dNone):"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"    op.add_column(\u0027ml2_network_segments\u0027,"},{"line_number":35,"context_line":"                  sa.Column(\u0027dynamic_segment\u0027, sa.Boolean(), default\u003dFalse,"},{"line_number":36,"context_line":"                  nullable\u003dFalse, server_default\u003dsa.sql.false()))"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"1abeadc6_cfa16947","line":35,"in_reply_to":"1abeadc6_1e0c84ec","updated":"2014-08-22 17:44:53.000000000","message":"Done","commit_id":"d6b7daafd411069a7e3fe974dba5481ed85a781d"},{"author":{"_account_id":7249,"name":"Ann Taraday","email":"akamyshnikova@mirantis.com","username":"AKamyshnikova"},"change_message_id":"5366d80a3b379365c11004f5b1e47a25b0dbacaf","unresolved":false,"context_lines":[{"line_number":33,"context_line":""},{"line_number":34,"context_line":"    op.add_column(\u0027ml2_network_segments\u0027,"},{"line_number":35,"context_line":"                  sa.Column(\u0027dynamic_segment\u0027, sa.Boolean(), default\u003dFalse,"},{"line_number":36,"context_line":"                  nullable\u003dFalse, server_default\u003dsa.sql.false()))"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"def downgrade(active_plugins\u003dNone, options\u003dNone):"}],"source_content_type":"text/x-python","patch_set":9,"id":"1abeadc6_9ecc148b","line":36,"updated":"2014-08-22 08:36:34.000000000","message":"There is no nullable\u003dFalse in model. Remove it here or add in model.","commit_id":"d6b7daafd411069a7e3fe974dba5481ed85a781d"},{"author":{"_account_id":107,"name":"Arvind Somya","email":"arvind.somya@gmail.com","username":"asomya"},"change_message_id":"0777e6b6fa4edd7077b68585714e7e1d19b0211a","unresolved":false,"context_lines":[{"line_number":33,"context_line":""},{"line_number":34,"context_line":"    op.add_column(\u0027ml2_network_segments\u0027,"},{"line_number":35,"context_line":"                  sa.Column(\u0027dynamic_segment\u0027, sa.Boolean(), default\u003dFalse,"},{"line_number":36,"context_line":"                  nullable\u003dFalse, server_default\u003dsa.sql.false()))"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"def downgrade(active_plugins\u003dNone, options\u003dNone):"}],"source_content_type":"text/x-python","patch_set":9,"id":"1abeadc6_ef8b85c0","line":36,"in_reply_to":"1abeadc6_9ecc148b","updated":"2014-08-22 17:44:53.000000000","message":"Done","commit_id":"d6b7daafd411069a7e3fe974dba5481ed85a781d"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"582fa0385e700b8246aa6d8b91d5524f0cb64cfc","unresolved":false,"context_lines":[{"line_number":15,"context_line":""},{"line_number":16,"context_line":"\"\"\"ml2_type_driver_refactor_dynamic_segments"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"Revision ID: 1f729449ce5f"},{"line_number":19,"context_line":"Revises: 4eba2f05c2f4"},{"line_number":20,"context_line":"Create Date: 2014-08-14 16:22:14.293788"},{"line_number":21,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"1abeadc6_2ebd4d03","line":18,"updated":"2014-08-25 12:41:04.000000000","message":"Revision ID should match the actual revision at L.25","commit_id":"279fbde75df50eaca7e4e42be6078a959bdb7d37"}],"neutron/plugins/ml2/db.py":[{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"f9cbb121e9069f268ff8c07696b5ded9fe201da7","unresolved":false,"context_lines":[{"line_number":73,"context_line":"                    api.NETWORK_TYPE: record.network_type,"},{"line_number":74,"context_line":"                    api.PHYSICAL_NETWORK: record.physical_network,"},{"line_number":75,"context_line":"                    api.SEGMENTATION_ID: record.segmentation_id,"},{"line_number":76,"context_line":"                    api.DYNAMIC_SEGMENT: record.dynamic_segment}"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"def add_port_binding(session, port_id):"}],"source_content_type":"text/x-python","patch_set":8,"id":"1abeadc6_d1387ff1","line":76,"updated":"2014-08-20 20:17:20.000000000","message":"Does this field need to be included? See my other comment in managers.py.","commit_id":"d18606a72f6b8dd9a3b63b22f736af02121c7f56"},{"author":{"_account_id":107,"name":"Arvind Somya","email":"arvind.somya@gmail.com","username":"asomya"},"change_message_id":"27a1a0d574ec40a42d83de14704ddcb9c489dbd0","unresolved":false,"context_lines":[{"line_number":73,"context_line":"                    api.NETWORK_TYPE: record.network_type,"},{"line_number":74,"context_line":"                    api.PHYSICAL_NETWORK: record.physical_network,"},{"line_number":75,"context_line":"                    api.SEGMENTATION_ID: record.segmentation_id,"},{"line_number":76,"context_line":"                    api.DYNAMIC_SEGMENT: record.dynamic_segment}"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"def add_port_binding(session, port_id):"}],"source_content_type":"text/x-python","patch_set":8,"id":"1abeadc6_1baf717e","line":76,"in_reply_to":"1abeadc6_d1387ff1","updated":"2014-08-20 20:35:46.000000000","message":"Not needed, I just added it for testing. I\u0027ll remove it.","commit_id":"d18606a72f6b8dd9a3b63b22f736af02121c7f56"},{"author":{"_account_id":1689,"name":"Robert Kukura","email":"rk@theep.net","username":"rkukura"},"change_message_id":"9dc5ba3137cff86a8513a3ecb07c5548d397ad8c","unresolved":false,"context_lines":[{"line_number":41,"context_line":"            segmentation_id\u003dsegment.get(api.SEGMENTATION_ID),"},{"line_number":42,"context_line":"            dynamic_segment\u003ddynamic_segment"},{"line_number":43,"context_line":"        )"},{"line_number":44,"context_line":"        session.add(record)"},{"line_number":45,"context_line":"    LOG.info(_(\"Added segment %(id)s of type %(network_type)s for network\""},{"line_number":46,"context_line":"               \" %(network_id)s\"),"},{"line_number":47,"context_line":"             {\u0027id\u0027: record.id,"}],"source_content_type":"text/x-python","patch_set":9,"id":"1abeadc6_b79e5b61","line":44,"updated":"2014-08-22 16:29:46.000000000","message":"I think you need:\n\n segment[api.ID] \u003d record.id\n\nso that the dynamic segment returned to the driver contains its ID. I\u0027ve included this in https://review.openstack.org/#/c/116209/1/neutron/plugins/ml2/db.py, but it would make sense to move it here since the dynamic segment cannot be used with context.continue_binding() without knowing its ID.","commit_id":"d6b7daafd411069a7e3fe974dba5481ed85a781d"},{"author":{"_account_id":107,"name":"Arvind Somya","email":"arvind.somya@gmail.com","username":"asomya"},"change_message_id":"0777e6b6fa4edd7077b68585714e7e1d19b0211a","unresolved":false,"context_lines":[{"line_number":41,"context_line":"            segmentation_id\u003dsegment.get(api.SEGMENTATION_ID),"},{"line_number":42,"context_line":"            dynamic_segment\u003ddynamic_segment"},{"line_number":43,"context_line":"        )"},{"line_number":44,"context_line":"        session.add(record)"},{"line_number":45,"context_line":"    LOG.info(_(\"Added segment %(id)s of type %(network_type)s for network\""},{"line_number":46,"context_line":"               \" %(network_id)s\"),"},{"line_number":47,"context_line":"             {\u0027id\u0027: record.id,"}],"source_content_type":"text/x-python","patch_set":9,"id":"1abeadc6_cf6fa9fa","line":44,"in_reply_to":"1abeadc6_b79e5b61","updated":"2014-08-22 17:44:53.000000000","message":"Done","commit_id":"d6b7daafd411069a7e3fe974dba5481ed85a781d"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"8f1287e157359eaa77cf7f880c4dc7606c6718b5","unresolved":false,"context_lines":[{"line_number":71,"context_line":"            query \u003d query.filter_by(physical_network\u003dphysical_network)"},{"line_number":72,"context_line":"        if segmentation_id:"},{"line_number":73,"context_line":"            query \u003d query.filter_by(segmentation_id\u003dsegmentation_id)"},{"line_number":74,"context_line":"        record \u003d query.first()"},{"line_number":75,"context_line":"        if record:"},{"line_number":76,"context_line":"            return {api.ID: record.id,"},{"line_number":77,"context_line":"                    api.NETWORK_TYPE: record.network_type,"}],"source_content_type":"text/x-python","patch_set":11,"id":"1abeadc6_2e3d48bc","line":74,"updated":"2014-08-25 16:49:05.000000000","message":"do we want to use .one here?","commit_id":"b804344a06e844db6337b9a8903f452f5c24ab83"},{"author":{"_account_id":107,"name":"Arvind Somya","email":"arvind.somya@gmail.com","username":"asomya"},"change_message_id":"7c9151e6f546a9658815b976853f41372f5dcb56","unresolved":false,"context_lines":[{"line_number":71,"context_line":"            query \u003d query.filter_by(physical_network\u003dphysical_network)"},{"line_number":72,"context_line":"        if segmentation_id:"},{"line_number":73,"context_line":"            query \u003d query.filter_by(segmentation_id\u003dsegmentation_id)"},{"line_number":74,"context_line":"        record \u003d query.first()"},{"line_number":75,"context_line":"        if record:"},{"line_number":76,"context_line":"            return {api.ID: record.id,"},{"line_number":77,"context_line":"                    api.NETWORK_TYPE: record.network_type,"}],"source_content_type":"text/x-python","patch_set":11,"id":"1abeadc6_7830de07","line":74,"in_reply_to":"1abeadc6_2e3d48bc","updated":"2014-08-25 17:12:51.000000000","message":"Done","commit_id":"b804344a06e844db6337b9a8903f452f5c24ab83"},{"author":{"_account_id":1689,"name":"Robert Kukura","email":"rk@theep.net","username":"rkukura"},"change_message_id":"484f6281a2727ab3a1653a312d04a5def431874c","unresolved":false,"context_lines":[{"line_number":71,"context_line":"            query \u003d query.filter_by(physical_network\u003dphysical_network)"},{"line_number":72,"context_line":"        if segmentation_id:"},{"line_number":73,"context_line":"            query \u003d query.filter_by(segmentation_id\u003dsegmentation_id)"},{"line_number":74,"context_line":"        record \u003d query.first()"},{"line_number":75,"context_line":"        if record:"},{"line_number":76,"context_line":"            return {api.ID: record.id,"},{"line_number":77,"context_line":"                    api.NETWORK_TYPE: record.network_type,"}],"source_content_type":"text/x-python","patch_set":11,"id":"1abeadc6_5354e520","line":74,"in_reply_to":"1abeadc6_7830de07","updated":"2014-08-25 17:37:14.000000000","message":"I\u0027m a bit concerned with this. Are we sure its absolutely impossible to wind up with multiple segments with the specified properties?","commit_id":"b804344a06e844db6337b9a8903f452f5c24ab83"},{"author":{"_account_id":1689,"name":"Robert Kukura","email":"rk@theep.net","username":"rkukura"},"change_message_id":"b56a545fe753505aed6ac4e10abe746e530e9e3a","unresolved":false,"context_lines":[{"line_number":71,"context_line":"        query \u003d query.filter_by(physical_network\u003dphysical_network)"},{"line_number":72,"context_line":"    if segmentation_id:"},{"line_number":73,"context_line":"        query \u003d query.filter_by(segmentation_id\u003dsegmentation_id)"},{"line_number":74,"context_line":"    record \u003d query.one()"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"    return record"},{"line_number":77,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"1abeadc6_20254cab","line":74,"updated":"2014-08-25 19:15:38.000000000","message":"Are you 100% certain there is no way multiple segments could be returned by the query (i.e. multiple threads tried to create segments with the same properties simultaneously)? If this is possible, maybe just using the first is safer.","commit_id":"818c1b9009a56585a2cdb0d877e9532d97dd67af"},{"author":{"_account_id":107,"name":"Arvind Somya","email":"arvind.somya@gmail.com","username":"asomya"},"change_message_id":"21480241e7d46c7d8aae3c6d9c5b0a3f3413398e","unresolved":false,"context_lines":[{"line_number":71,"context_line":"        query \u003d query.filter_by(physical_network\u003dphysical_network)"},{"line_number":72,"context_line":"    if segmentation_id:"},{"line_number":73,"context_line":"        query \u003d query.filter_by(segmentation_id\u003dsegmentation_id)"},{"line_number":74,"context_line":"    record \u003d query.one()"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"    return record"},{"line_number":77,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"1abeadc6_0b44f172","line":74,"in_reply_to":"1abeadc6_20254cab","updated":"2014-08-25 20:56:58.000000000","message":"Yeah I didn\u0027t account for that corner case, I\u0027ll switch it to first again.","commit_id":"818c1b9009a56585a2cdb0d877e9532d97dd67af"},{"author":{"_account_id":1689,"name":"Robert Kukura","email":"rk@theep.net","username":"rkukura"},"change_message_id":"b56a545fe753505aed6ac4e10abe746e530e9e3a","unresolved":false,"context_lines":[{"line_number":100,"context_line":"                    api.SEGMENTATION_ID: record.segmentation_id}"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"def release_dynamic_segment(session, network_id, physical_network\u003dNone,"},{"line_number":104,"context_line":"                            segmentation_id\u003dNone):"},{"line_number":105,"context_line":"    \"\"\"Release a dynamic segment for the params provided if one exists.\"\"\""},{"line_number":106,"context_line":"    with session.begin(subtransactions\u003dTrue):"}],"source_content_type":"text/x-python","patch_set":13,"id":"1abeadc6_3d0bb32c","line":103,"updated":"2014-08-25 19:15:38.000000000","message":"Wouldn\u0027t it be safer to release the segment based on its ID rather than matching properties, as I suggested previously? That would avoid any issue of multiple segments matching.","commit_id":"818c1b9009a56585a2cdb0d877e9532d97dd67af"},{"author":{"_account_id":107,"name":"Arvind Somya","email":"arvind.somya@gmail.com","username":"asomya"},"change_message_id":"21480241e7d46c7d8aae3c6d9c5b0a3f3413398e","unresolved":false,"context_lines":[{"line_number":100,"context_line":"                    api.SEGMENTATION_ID: record.segmentation_id}"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"def release_dynamic_segment(session, network_id, physical_network\u003dNone,"},{"line_number":104,"context_line":"                            segmentation_id\u003dNone):"},{"line_number":105,"context_line":"    \"\"\"Release a dynamic segment for the params provided if one exists.\"\"\""},{"line_number":106,"context_line":"    with session.begin(subtransactions\u003dTrue):"}],"source_content_type":"text/x-python","patch_set":13,"id":"1abeadc6_d15f0874","line":103,"in_reply_to":"1abeadc6_3d0bb32c","updated":"2014-08-25 20:56:58.000000000","message":"Done","commit_id":"818c1b9009a56585a2cdb0d877e9532d97dd67af"},{"author":{"_account_id":1689,"name":"Robert Kukura","email":"rk@theep.net","username":"rkukura"},"change_message_id":"46f135c0ee2652f62616d5360df14b4a587c6ac6","unresolved":false,"context_lines":[{"line_number":50,"context_line":"              \u0027network_id\u0027: record.network_id})"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"def get_network_segments(session, network_id):"},{"line_number":54,"context_line":"    with session.begin(subtransactions\u003dTrue):"},{"line_number":55,"context_line":"        records \u003d (session.query(models.NetworkSegment)."},{"line_number":56,"context_line":"                   filter_by(network_id\u003dnetwork_id)."}],"source_content_type":"text/x-python","patch_set":15,"id":"1abeadc6_ce85505a","line":53,"updated":"2014-08-27 15:38:10.000000000","message":"Why not make this a general purpose function: get_network_segments(session, network_id, filter_dynamic\u003dFalse)?\n\nExisting uses would return the static segments, but by passing filter_dynamic\u003dTrue, only the dynamic segments would be returned, and by passing filter_dynamic\u003dNone, all segments would be returned.","commit_id":"316c0e8763426c9ef5786a7b71c7d5cc47465a1a"},{"author":{"_account_id":107,"name":"Arvind Somya","email":"arvind.somya@gmail.com","username":"asomya"},"change_message_id":"7f54807f3e494e62e2aed7decb9dc201a6466e5e","unresolved":false,"context_lines":[{"line_number":50,"context_line":"              \u0027network_id\u0027: record.network_id})"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"def get_network_segments(session, network_id):"},{"line_number":54,"context_line":"    with session.begin(subtransactions\u003dTrue):"},{"line_number":55,"context_line":"        records \u003d (session.query(models.NetworkSegment)."},{"line_number":56,"context_line":"                   filter_by(network_id\u003dnetwork_id)."}],"source_content_type":"text/x-python","patch_set":15,"id":"1abeadc6_eed12cce","line":53,"in_reply_to":"1abeadc6_ce85505a","updated":"2014-08-27 16:07:48.000000000","message":"Done","commit_id":"316c0e8763426c9ef5786a7b71c7d5cc47465a1a"},{"author":{"_account_id":1689,"name":"Robert Kukura","email":"rk@theep.net","username":"rkukura"},"change_message_id":"46f135c0ee2652f62616d5360df14b4a587c6ac6","unresolved":false,"context_lines":[{"line_number":108,"context_line":"    \"\"\"Return all dynamic segments for a network.\"\"\""},{"line_number":109,"context_line":"    with session.begin(subtransactions\u003dTrue):"},{"line_number":110,"context_line":"        return (session.query(models.NetworkSegment)."},{"line_number":111,"context_line":"                filter_by(network_id\u003dnetwork_id, dynamic_segment\u003dTrue).all())"},{"line_number":112,"context_line":""},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"def release_dynamic_segment(session, segment_id):"}],"source_content_type":"text/x-python","patch_set":15,"id":"1abeadc6_4e0ea033","line":111,"updated":"2014-08-27 15:38:10.000000000","message":"This function can be eliminated and replaced by get_network_segments(session, network_id, filter_dynamic\u003dTrue).","commit_id":"316c0e8763426c9ef5786a7b71c7d5cc47465a1a"},{"author":{"_account_id":107,"name":"Arvind Somya","email":"arvind.somya@gmail.com","username":"asomya"},"change_message_id":"7f54807f3e494e62e2aed7decb9dc201a6466e5e","unresolved":false,"context_lines":[{"line_number":108,"context_line":"    \"\"\"Return all dynamic segments for a network.\"\"\""},{"line_number":109,"context_line":"    with session.begin(subtransactions\u003dTrue):"},{"line_number":110,"context_line":"        return (session.query(models.NetworkSegment)."},{"line_number":111,"context_line":"                filter_by(network_id\u003dnetwork_id, dynamic_segment\u003dTrue).all())"},{"line_number":112,"context_line":""},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"def release_dynamic_segment(session, segment_id):"}],"source_content_type":"text/x-python","patch_set":15,"id":"1abeadc6_4ed6a0c4","line":111,"in_reply_to":"1abeadc6_4e0ea033","updated":"2014-08-27 16:07:48.000000000","message":"Done","commit_id":"316c0e8763426c9ef5786a7b71c7d5cc47465a1a"},{"author":{"_account_id":1689,"name":"Robert Kukura","email":"rk@theep.net","username":"rkukura"},"change_message_id":"9714193db657f67cda59a58dfd54e7430b077ec5","unresolved":false,"context_lines":[{"line_number":54,"context_line":"    with session.begin(subtransactions\u003dTrue):"},{"line_number":55,"context_line":"        records \u003d (session.query(models.NetworkSegment)."},{"line_number":56,"context_line":"                   filter_by(network_id\u003dnetwork_id)."},{"line_number":57,"context_line":"                   filter_by(dynamic_segment\u003dfilter_dynamic))"},{"line_number":58,"context_line":"        return [{api.ID: record.id,"},{"line_number":59,"context_line":"                 api.NETWORK_TYPE: record.network_type,"},{"line_number":60,"context_line":"                 api.PHYSICAL_NETWORK: record.physical_network,"}],"source_content_type":"text/x-python","patch_set":16,"id":"1abeadc6_09965d4c","line":57,"updated":"2014-08-27 18:34:06.000000000","message":"I cannot find evidence in the sqlalchemy documentation that filter_by(dynamic_segment\u003dNone) allows records with True or False in the dynamic_segment column to be returned. I\u0027m concerned that it instead only allows records with a null dynamic_segment to be returned, which is not what we are looking for. I think it would be safer and clearer to only append this filter_by when \"filter_dynamic is not None\".","commit_id":"30cc1b4ac4a7f361222176fc53ae082423476ec0"},{"author":{"_account_id":107,"name":"Arvind Somya","email":"arvind.somya@gmail.com","username":"asomya"},"change_message_id":"4cea7a97512bb8091ffd3afb0743b227044441fc","unresolved":false,"context_lines":[{"line_number":54,"context_line":"    with session.begin(subtransactions\u003dTrue):"},{"line_number":55,"context_line":"        records \u003d (session.query(models.NetworkSegment)."},{"line_number":56,"context_line":"                   filter_by(network_id\u003dnetwork_id)."},{"line_number":57,"context_line":"                   filter_by(dynamic_segment\u003dfilter_dynamic))"},{"line_number":58,"context_line":"        return [{api.ID: record.id,"},{"line_number":59,"context_line":"                 api.NETWORK_TYPE: record.network_type,"},{"line_number":60,"context_line":"                 api.PHYSICAL_NETWORK: record.physical_network,"}],"source_content_type":"text/x-python","patch_set":16,"id":"1abeadc6_cc32b35d","line":57,"in_reply_to":"1abeadc6_09965d4c","updated":"2014-08-27 19:04:02.000000000","message":"Done, also i\u0027m changing the naming here a bit, renaming filter_dynamic to include_dynamic.","commit_id":"30cc1b4ac4a7f361222176fc53ae082423476ec0"},{"author":{"_account_id":1689,"name":"Robert Kukura","email":"rk@theep.net","username":"rkukura"},"change_message_id":"9714193db657f67cda59a58dfd54e7430b077ec5","unresolved":false,"context_lines":[{"line_number":104,"context_line":"            return None"},{"line_number":105,"context_line":""},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"def release_dynamic_segment(session, segment_id):"},{"line_number":108,"context_line":"    \"\"\"Release a dynamic segment for the params provided if one exists.\"\"\""},{"line_number":109,"context_line":"    with session.begin(subtransactions\u003dTrue):"},{"line_number":110,"context_line":"        (session.query(models.NetworkSegment)."}],"source_content_type":"text/x-python","patch_set":16,"id":"1abeadc6_e95cc17f","line":107,"updated":"2014-08-27 18:34:06.000000000","message":"I\u0027d rename this to delete_segment() or remove_segment(), and remove the dynamic_segment\u003dTrue from the filter_by(). That way, it could be used for static segments as well, if we ever allow these to be added and removed in network updates.\n\nAlso, to me, \"release\" means \"return to the pool\", whereas this code is deleting or removing the DB record.","commit_id":"30cc1b4ac4a7f361222176fc53ae082423476ec0"},{"author":{"_account_id":107,"name":"Arvind Somya","email":"arvind.somya@gmail.com","username":"asomya"},"change_message_id":"4cea7a97512bb8091ffd3afb0743b227044441fc","unresolved":false,"context_lines":[{"line_number":104,"context_line":"            return None"},{"line_number":105,"context_line":""},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"def release_dynamic_segment(session, segment_id):"},{"line_number":108,"context_line":"    \"\"\"Release a dynamic segment for the params provided if one exists.\"\"\""},{"line_number":109,"context_line":"    with session.begin(subtransactions\u003dTrue):"},{"line_number":110,"context_line":"        (session.query(models.NetworkSegment)."}],"source_content_type":"text/x-python","patch_set":16,"id":"1abeadc6_cce473e2","line":107,"in_reply_to":"1abeadc6_e95cc17f","updated":"2014-08-27 19:04:02.000000000","message":"Done","commit_id":"30cc1b4ac4a7f361222176fc53ae082423476ec0"},{"author":{"_account_id":1689,"name":"Robert Kukura","email":"rk@theep.net","username":"rkukura"},"change_message_id":"58dd2dd1e9417ba96eb49e100626dc715eda38ce","unresolved":false,"context_lines":[{"line_number":55,"context_line":"        query \u003d (session.query(models.NetworkSegment)."},{"line_number":56,"context_line":"                 filter_by(network_id\u003dnetwork_id))"},{"line_number":57,"context_line":"        if not include_dynamic:"},{"line_number":58,"context_line":"            query \u003d query.filter_by(is_dynamic\u003dFalse)"},{"line_number":59,"context_line":"        records \u003d query.all()"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"        return [{api.ID: record.id,"}],"source_content_type":"text/x-python","patch_set":17,"id":"1abeadc6_32245e0c","line":58,"updated":"2014-08-27 19:55:09.000000000","message":"In order to handle all three cases (static-only, dynamic-only, and both), the above two lines could be:\n\nif filter_dynamic is not None:\n    query \u003d query.filter_by(is_dynamic\u003dfilter_dynamic)\n\nIf you do this, then I think the \"filter_dynamic\" name is preferable , since its not just a choice of whether to include the dynamic segments or not. I think of \"filter_dynamic\" as short for \"filter on the is_dynamic column (if not None)\".","commit_id":"cff358cd824bc16e01f8023ef553c5e26943bdee"},{"author":{"_account_id":107,"name":"Arvind Somya","email":"arvind.somya@gmail.com","username":"asomya"},"change_message_id":"33325288d19b9ad74bfcb7f74ca7b3708262c4fd","unresolved":false,"context_lines":[{"line_number":55,"context_line":"        query \u003d (session.query(models.NetworkSegment)."},{"line_number":56,"context_line":"                 filter_by(network_id\u003dnetwork_id))"},{"line_number":57,"context_line":"        if not include_dynamic:"},{"line_number":58,"context_line":"            query \u003d query.filter_by(is_dynamic\u003dFalse)"},{"line_number":59,"context_line":"        records \u003d query.all()"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"        return [{api.ID: record.id,"}],"source_content_type":"text/x-python","patch_set":17,"id":"1abeadc6_b81e8d6e","line":58,"in_reply_to":"1abeadc6_32245e0c","updated":"2014-08-27 20:45:57.000000000","message":"Done","commit_id":"cff358cd824bc16e01f8023ef553c5e26943bdee"},{"author":{"_account_id":1689,"name":"Robert Kukura","email":"rk@theep.net","username":"rkukura"},"change_message_id":"58dd2dd1e9417ba96eb49e100626dc715eda38ce","unresolved":false,"context_lines":[{"line_number":95,"context_line":"            return {api.ID: record.id,"},{"line_number":96,"context_line":"                    api.NETWORK_TYPE: record.network_type,"},{"line_number":97,"context_line":"                    api.PHYSICAL_NETWORK: record.physical_network,"},{"line_number":98,"context_line":"                    api.SEGMENTATION_ID: record.segmentation_id}"},{"line_number":99,"context_line":"        else:"},{"line_number":100,"context_line":"            LOG.debug(\"No dynamic segment %s found for \""},{"line_number":101,"context_line":"                      \"Network:%(network_id)s, \""}],"source_content_type":"text/x-python","patch_set":17,"id":"1abeadc6_5d8d6b7b","line":98,"updated":"2014-08-27 19:55:09.000000000","message":"Nit - This patch adds two new copies of the above four lines of code. Maybe its time to add a _make_segment_dict(self, record) function and use is in all such places.","commit_id":"cff358cd824bc16e01f8023ef553c5e26943bdee"},{"author":{"_account_id":107,"name":"Arvind Somya","email":"arvind.somya@gmail.com","username":"asomya"},"change_message_id":"33325288d19b9ad74bfcb7f74ca7b3708262c4fd","unresolved":false,"context_lines":[{"line_number":95,"context_line":"            return {api.ID: record.id,"},{"line_number":96,"context_line":"                    api.NETWORK_TYPE: record.network_type,"},{"line_number":97,"context_line":"                    api.PHYSICAL_NETWORK: record.physical_network,"},{"line_number":98,"context_line":"                    api.SEGMENTATION_ID: record.segmentation_id}"},{"line_number":99,"context_line":"        else:"},{"line_number":100,"context_line":"            LOG.debug(\"No dynamic segment %s found for \""},{"line_number":101,"context_line":"                      \"Network:%(network_id)s, \""}],"source_content_type":"text/x-python","patch_set":17,"id":"1abeadc6_f814854e","line":98,"in_reply_to":"1abeadc6_5d8d6b7b","updated":"2014-08-27 20:45:57.000000000","message":"Done","commit_id":"cff358cd824bc16e01f8023ef553c5e26943bdee"}],"neutron/plugins/ml2/driver_api.py":[{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"8f1287e157359eaa77cf7f880c4dc7606c6718b5","unresolved":false,"context_lines":[{"line_number":25,"context_line":"NETWORK_TYPE \u003d \u0027network_type\u0027"},{"line_number":26,"context_line":"PHYSICAL_NETWORK \u003d \u0027physical_network\u0027"},{"line_number":27,"context_line":"SEGMENTATION_ID \u003d \u0027segmentation_id\u0027"},{"line_number":28,"context_line":"DYNAMIC_SEGMENT \u003d \u0027dynamic_segment\u0027"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"@six.add_metaclass(abc.ABCMeta)"}],"source_content_type":"text/x-python","patch_set":11,"id":"1abeadc6_1ae447ab","line":28,"updated":"2014-08-25 16:49:05.000000000","message":"is this being used?","commit_id":"b804344a06e844db6337b9a8903f452f5c24ab83"},{"author":{"_account_id":107,"name":"Arvind Somya","email":"arvind.somya@gmail.com","username":"asomya"},"change_message_id":"7c9151e6f546a9658815b976853f41372f5dcb56","unresolved":false,"context_lines":[{"line_number":25,"context_line":"NETWORK_TYPE \u003d \u0027network_type\u0027"},{"line_number":26,"context_line":"PHYSICAL_NETWORK \u003d \u0027physical_network\u0027"},{"line_number":27,"context_line":"SEGMENTATION_ID \u003d \u0027segmentation_id\u0027"},{"line_number":28,"context_line":"DYNAMIC_SEGMENT \u003d \u0027dynamic_segment\u0027"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"@six.add_metaclass(abc.ABCMeta)"}],"source_content_type":"text/x-python","patch_set":11,"id":"1abeadc6_582b2294","line":28,"in_reply_to":"1abeadc6_1ae447ab","updated":"2014-08-25 17:12:51.000000000","message":"Not being used, I\u0027ll remove it.","commit_id":"b804344a06e844db6337b9a8903f452f5c24ab83"},{"author":{"_account_id":1689,"name":"Robert Kukura","email":"rk@theep.net","username":"rkukura"},"change_message_id":"2af100607cd708d271a75c4d12b4b52c7354fe53","unresolved":false,"context_lines":[{"line_number":344,"context_line":""},{"line_number":345,"context_line":"    def allocate_dynamic_segment(self, segment):"},{"line_number":346,"context_line":"        \"\"\"Allocate a dynamic segment for the port.\"\"\""},{"line_number":347,"context_line":"        pass"},{"line_number":348,"context_line":""},{"line_number":349,"context_line":""},{"line_number":350,"context_line":"@six.add_metaclass(abc.ABCMeta)"}],"source_content_type":"text/x-python","patch_set":12,"id":"1abeadc6_11f7cd8d","line":347,"updated":"2014-08-25 15:24:27.000000000","message":"I think we also need a release_dynamic_segment(self, segment_id) method on PortContext. Obviously, deleting the network will delete all its segments, including any dynamic segments. But mechanism drivers processing update_port_precommit() when a port becomes unbound could detect that no other bound port requires the dynamic segment, and release it via PortContext.release_dynamic_segment().\n\nAlternatively, we could consider having the plugin automatically release dynamic segments when the last port binding that uses them is torn down.\n\nEither way, we need to consider what happens when a dynamic segment is allocated during a bind_port() call, but doesn\u0027t end up getting used in a binding that is committed to the DB. This could happen if no other driver is able to complete the binding using the dynamic segment, if the server dies before committing the binding, if some other server/thread commits another binding for the port first, or if some port attribute is changed before the binding commits. Right now, I think mechanism drivers will have to do the bookkeeping to know which dynamic segments are actually in-use during the update_port_precommit() calls made as port bindings are created and destroyed, calling release_dynamic_segment() when a segment is no longer needed.\n\nMaybe we should eventually add some general cleanup mechanism that periodically purges dynamic segments that don\u0027t belong to any committed port binding, possibly sparing ones under some minimum age so that they don\u0027t get purged during binding. If we did this, I think we\u0027d need a way to tell the mechanism drivers about purged segments, so they could cleanup any associated data of their own. My current thinking is that we should consider this automatic cleanup as a future enhancement after getting some experience with dynamic segments.","commit_id":"c82ca87784e9c5d10154ebec84c7763055ebebea"},{"author":{"_account_id":107,"name":"Arvind Somya","email":"arvind.somya@gmail.com","username":"asomya"},"change_message_id":"715dbaef0fe857f01c2e27809235960b17546835","unresolved":false,"context_lines":[{"line_number":344,"context_line":""},{"line_number":345,"context_line":"    def allocate_dynamic_segment(self, segment):"},{"line_number":346,"context_line":"        \"\"\"Allocate a dynamic segment for the port.\"\"\""},{"line_number":347,"context_line":"        pass"},{"line_number":348,"context_line":""},{"line_number":349,"context_line":""},{"line_number":350,"context_line":"@six.add_metaclass(abc.ABCMeta)"}],"source_content_type":"text/x-python","patch_set":12,"id":"1abeadc6_84b9ddee","line":347,"in_reply_to":"1abeadc6_11f7cd8d","updated":"2014-08-25 16:27:37.000000000","message":"Yeah we do need one, I\u0027ll add a method in portcontext to release the segment and another method in the manager to check if it\u0027s the last segment for that physnet and delete the segment row if true. good catch!","commit_id":"c82ca87784e9c5d10154ebec84c7763055ebebea"},{"author":{"_account_id":1689,"name":"Robert Kukura","email":"rk@theep.net","username":"rkukura"},"change_message_id":"bfe24075331720e368955a2668e1e1e08bf28c88","unresolved":false,"context_lines":[{"line_number":344,"context_line":""},{"line_number":345,"context_line":"    def allocate_dynamic_segment(self, segment):"},{"line_number":346,"context_line":"        \"\"\"Allocate a dynamic segment for the port.\"\"\""},{"line_number":347,"context_line":"        pass"},{"line_number":348,"context_line":""},{"line_number":349,"context_line":""},{"line_number":350,"context_line":"@six.add_metaclass(abc.ABCMeta)"}],"source_content_type":"text/x-python","patch_set":12,"id":"1abeadc6_fd706075","line":347,"in_reply_to":"1abeadc6_84b9ddee","updated":"2014-08-25 16:34:39.000000000","message":"I\u0027m not quite sure what you mean by \"check if it\u0027s the last segment for that physnet\". Can you clarify?","commit_id":"c82ca87784e9c5d10154ebec84c7763055ebebea"},{"author":{"_account_id":107,"name":"Arvind Somya","email":"arvind.somya@gmail.com","username":"asomya"},"change_message_id":"6bc1dbd275b858a60b2f669a99e99bf80b8ce729","unresolved":false,"context_lines":[{"line_number":344,"context_line":""},{"line_number":345,"context_line":"    def allocate_dynamic_segment(self, segment):"},{"line_number":346,"context_line":"        \"\"\"Allocate a dynamic segment for the port.\"\"\""},{"line_number":347,"context_line":"        pass"},{"line_number":348,"context_line":""},{"line_number":349,"context_line":""},{"line_number":350,"context_line":"@six.add_metaclass(abc.ABCMeta)"}],"source_content_type":"text/x-python","patch_set":12,"id":"1abeadc6_b8b51680","line":347,"in_reply_to":"1abeadc6_fd706075","updated":"2014-08-25 17:13:12.000000000","message":"I thought we could implement your second suggestion of having the ML2 plugin automatically release the dynamic segment. I worded that incorrectly, I meant last port on that physnet using that dynamic segment. I realized when i started coding it, I have no way to deduce if a port is the only one left in a physnet inside ML2/Neutron, that piece of logic needs to reside in the mechanism driver till we do the greater refactor. I\u0027ll just add a dumb method to whack the row and throw the onus on the mechanism driver for now.","commit_id":"c82ca87784e9c5d10154ebec84c7763055ebebea"},{"author":{"_account_id":1689,"name":"Robert Kukura","email":"rk@theep.net","username":"rkukura"},"change_message_id":"b56a545fe753505aed6ac4e10abe746e530e9e3a","unresolved":false,"context_lines":[{"line_number":153,"context_line":"        \"\"\"Release an allocated dynamic segment."},{"line_number":154,"context_line":""},{"line_number":155,"context_line":"        :param network_id: UUID of the network"},{"line_number":156,"context_line":"        :param segment: A partially specified segment dictionary"},{"line_number":157,"context_line":""},{"line_number":158,"context_line":"        Optional method called from the mechanism drivers after delete_port"},{"line_number":159,"context_line":"        to remove the dynamic segment allocated for this physical_network."}],"source_content_type":"text/x-python","patch_set":13,"id":"1abeadc6_20738cb2","line":156,"updated":"2014-08-25 19:15:38.000000000","message":"Why not release the segment based on its segment_id? Are we sure partial matches will always uniquely identify the segment?","commit_id":"818c1b9009a56585a2cdb0d877e9532d97dd67af"},{"author":{"_account_id":107,"name":"Arvind Somya","email":"arvind.somya@gmail.com","username":"asomya"},"change_message_id":"21480241e7d46c7d8aae3c6d9c5b0a3f3413398e","unresolved":false,"context_lines":[{"line_number":153,"context_line":"        \"\"\"Release an allocated dynamic segment."},{"line_number":154,"context_line":""},{"line_number":155,"context_line":"        :param network_id: UUID of the network"},{"line_number":156,"context_line":"        :param segment: A partially specified segment dictionary"},{"line_number":157,"context_line":""},{"line_number":158,"context_line":"        Optional method called from the mechanism drivers after delete_port"},{"line_number":159,"context_line":"        to remove the dynamic segment allocated for this physical_network."}],"source_content_type":"text/x-python","patch_set":13,"id":"1abeadc6_a645f4b4","line":156,"in_reply_to":"1abeadc6_20738cb2","updated":"2014-08-25 20:56:58.000000000","message":"I assume you mean the record ID? segmentation_id\u0027s can be reused across physnets. We still need some segment information to call the type driver\u0027s release segment, If i just accept the ID, the type manage will have to get the row from the DB for details for the type driver. I\u0027ve changed it to a full segment dictionary with the record ID.","commit_id":"818c1b9009a56585a2cdb0d877e9532d97dd67af"},{"author":{"_account_id":1689,"name":"Robert Kukura","email":"rk@theep.net","username":"rkukura"},"change_message_id":"d121cbe2eb45a9df5a79d674eb8ff0cf7c1c24e3","unresolved":false,"context_lines":[{"line_number":153,"context_line":"        \"\"\"Release an allocated dynamic segment."},{"line_number":154,"context_line":""},{"line_number":155,"context_line":"        :param network_id: UUID of the network"},{"line_number":156,"context_line":"        :param segment: A partially specified segment dictionary"},{"line_number":157,"context_line":""},{"line_number":158,"context_line":"        Optional method called from the mechanism drivers after delete_port"},{"line_number":159,"context_line":"        to remove the dynamic segment allocated for this physical_network."}],"source_content_type":"text/x-python","patch_set":13,"id":"1abeadc6_d943aa6a","line":156,"in_reply_to":"1abeadc6_2340f134","updated":"2014-08-26 00:19:46.000000000","message":"No, we can\u0027t have a cyclic dependency between patches. Just copy the function into your patch, and it will disappear from mine when I rebase.","commit_id":"818c1b9009a56585a2cdb0d877e9532d97dd67af"},{"author":{"_account_id":1689,"name":"Robert Kukura","email":"rk@theep.net","username":"rkukura"},"change_message_id":"28883123d52d59ad0c49bf7f566a12dda095700a","unresolved":false,"context_lines":[{"line_number":153,"context_line":"        \"\"\"Release an allocated dynamic segment."},{"line_number":154,"context_line":""},{"line_number":155,"context_line":"        :param network_id: UUID of the network"},{"line_number":156,"context_line":"        :param segment: A partially specified segment dictionary"},{"line_number":157,"context_line":""},{"line_number":158,"context_line":"        Optional method called from the mechanism drivers after delete_port"},{"line_number":159,"context_line":"        to remove the dynamic segment allocated for this physical_network."}],"source_content_type":"text/x-python","patch_set":13,"id":"1abeadc6_e0598f8f","line":156,"in_reply_to":"1abeadc6_8cf017cb","updated":"2014-08-25 22:04:29.000000000","message":"This get_segment_by_id() is needed to fetch the segment dictionary so mechanism drivers have access to all the properties, but the set_binding() and continue_binding() calls are in terms of just the IDs. I think using just the ID for release_segment() would be most consistent.","commit_id":"818c1b9009a56585a2cdb0d877e9532d97dd67af"},{"author":{"_account_id":107,"name":"Arvind Somya","email":"arvind.somya@gmail.com","username":"asomya"},"change_message_id":"e36b22bf390a2d769249bd6ffb8a684c5633e3b6","unresolved":false,"context_lines":[{"line_number":153,"context_line":"        \"\"\"Release an allocated dynamic segment."},{"line_number":154,"context_line":""},{"line_number":155,"context_line":"        :param network_id: UUID of the network"},{"line_number":156,"context_line":"        :param segment: A partially specified segment dictionary"},{"line_number":157,"context_line":""},{"line_number":158,"context_line":"        Optional method called from the mechanism drivers after delete_port"},{"line_number":159,"context_line":"        to remove the dynamic segment allocated for this physical_network."}],"source_content_type":"text/x-python","patch_set":13,"id":"1abeadc6_8cf017cb","line":156,"in_reply_to":"1abeadc6_9180308d","updated":"2014-08-25 21:21:47.000000000","message":"Didn\u0027t know that was added in, I was planning on adding one myself to db.py but my logic here was that the mech driver or context objects that have access to the dynamic segment record id will have the complete segment dictionary so we can just accept that instead of another DB call to grab the same information.","commit_id":"818c1b9009a56585a2cdb0d877e9532d97dd67af"},{"author":{"_account_id":1689,"name":"Robert Kukura","email":"rk@theep.net","username":"rkukura"},"change_message_id":"0747867a77337bc3f569e399352475a8b0f158dd","unresolved":false,"context_lines":[{"line_number":153,"context_line":"        \"\"\"Release an allocated dynamic segment."},{"line_number":154,"context_line":""},{"line_number":155,"context_line":"        :param network_id: UUID of the network"},{"line_number":156,"context_line":"        :param segment: A partially specified segment dictionary"},{"line_number":157,"context_line":""},{"line_number":158,"context_line":"        Optional method called from the mechanism drivers after delete_port"},{"line_number":159,"context_line":"        to remove the dynamic segment allocated for this physical_network."}],"source_content_type":"text/x-python","patch_set":13,"id":"1abeadc6_9180308d","line":156,"in_reply_to":"1abeadc6_a645f4b4","updated":"2014-08-25 21:03:06.000000000","message":"I do mean the record ID.\n\nWhy not just use the get_segment_by_id() function I added in https://review.openstack.org/#/c/116209/1/neutron/plugins/ml2/db.py?","commit_id":"818c1b9009a56585a2cdb0d877e9532d97dd67af"},{"author":{"_account_id":107,"name":"Arvind Somya","email":"arvind.somya@gmail.com","username":"asomya"},"change_message_id":"d9ee2defe4bef35cc3c7a89c03fcffcba781ea1a","unresolved":false,"context_lines":[{"line_number":153,"context_line":"        \"\"\"Release an allocated dynamic segment."},{"line_number":154,"context_line":""},{"line_number":155,"context_line":"        :param network_id: UUID of the network"},{"line_number":156,"context_line":"        :param segment: A partially specified segment dictionary"},{"line_number":157,"context_line":""},{"line_number":158,"context_line":"        Optional method called from the mechanism drivers after delete_port"},{"line_number":159,"context_line":"        to remove the dynamic segment allocated for this physical_network."}],"source_content_type":"text/x-python","patch_set":13,"id":"1abeadc6_8f638d40","line":156,"in_reply_to":"1abeadc6_d943aa6a","updated":"2014-08-26 13:45:59.000000000","message":"Done","commit_id":"818c1b9009a56585a2cdb0d877e9532d97dd67af"},{"author":{"_account_id":107,"name":"Arvind Somya","email":"arvind.somya@gmail.com","username":"asomya"},"change_message_id":"919ff7a8d0d495cd4ff0a1ae2275ec8b135b9b16","unresolved":false,"context_lines":[{"line_number":153,"context_line":"        \"\"\"Release an allocated dynamic segment."},{"line_number":154,"context_line":""},{"line_number":155,"context_line":"        :param network_id: UUID of the network"},{"line_number":156,"context_line":"        :param segment: A partially specified segment dictionary"},{"line_number":157,"context_line":""},{"line_number":158,"context_line":"        Optional method called from the mechanism drivers after delete_port"},{"line_number":159,"context_line":"        to remove the dynamic segment allocated for this physical_network."}],"source_content_type":"text/x-python","patch_set":13,"id":"1abeadc6_2340f134","line":156,"in_reply_to":"1abeadc6_e03a6fe6","updated":"2014-08-25 22:15:07.000000000","message":"Sorry that should go:\nRefactor part 2 —\u003e Hierarchical port bindings —\u003e DB Changes for HPB —\u003e Driver API for HPB —\u003e Refactor part 2","commit_id":"818c1b9009a56585a2cdb0d877e9532d97dd67af"},{"author":{"_account_id":107,"name":"Arvind Somya","email":"arvind.somya@gmail.com","username":"asomya"},"change_message_id":"c64eeb386df0db27effa072795feaa9c9496d7ed","unresolved":false,"context_lines":[{"line_number":153,"context_line":"        \"\"\"Release an allocated dynamic segment."},{"line_number":154,"context_line":""},{"line_number":155,"context_line":"        :param network_id: UUID of the network"},{"line_number":156,"context_line":"        :param segment: A partially specified segment dictionary"},{"line_number":157,"context_line":""},{"line_number":158,"context_line":"        Optional method called from the mechanism drivers after delete_port"},{"line_number":159,"context_line":"        to remove the dynamic segment allocated for this physical_network."}],"source_content_type":"text/x-python","patch_set":13,"id":"1abeadc6_e03a6fe6","line":156,"in_reply_to":"1abeadc6_e0598f8f","updated":"2014-08-25 22:12:04.000000000","message":"I can change it to depend on your patch for that method but doesn\u0027t that create a circular dependency loop?\nRefactor part 2 —\u003e DB Changes for HPB —\u003e Driver API for HPB —\u003e Refactor part 2","commit_id":"818c1b9009a56585a2cdb0d877e9532d97dd67af"},{"author":{"_account_id":1689,"name":"Robert Kukura","email":"rk@theep.net","username":"rkukura"},"change_message_id":"3e1cf5cb752f835bdfb3e708323921554785bbbb","unresolved":false,"context_lines":[{"line_number":145,"context_line":"        Optional method called from the mechanism drivers during create_port"},{"line_number":146,"context_line":"        or bind_port to dynamically allocate a segment for the network and the"},{"line_number":147,"context_line":"        partial segment specified. The partial segment only needs to have the"},{"line_number":148,"context_line":"        network_type populated to call on the appropriate type driver."},{"line_number":149,"context_line":"        \"\"\""},{"line_number":150,"context_line":"        pass"},{"line_number":151,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"1abeadc6_a17bf027","line":148,"updated":"2014-08-26 20:25:46.000000000","message":"This is too specific, and should look more like the doc string for allocate_tenant_segment. I\u0027d suggest:\n\nCalled inside transaction context on session to allocate a new dynamic segment for a network, for use in hierarchical port bindings, typically from a type-specific resource pool. The segment param specifies at least the network_type, and may also specify the physical_network and/or segmentation_id. If successful, return a segment dictionary fully describing the allocated segment. If a dynamic segment cannot be allocated, return None.","commit_id":"9ba3a0125630fc177620e1ada2ebcbdac45b842b"},{"author":{"_account_id":1689,"name":"Robert Kukura","email":"rk@theep.net","username":"rkukura"},"change_message_id":"3e1cf5cb752f835bdfb3e708323921554785bbbb","unresolved":false,"context_lines":[{"line_number":153,"context_line":"        \"\"\"Release an allocated dynamic segment."},{"line_number":154,"context_line":""},{"line_number":155,"context_line":"        :param network_id: UUID of the network"},{"line_number":156,"context_line":"        :param segment_id: UUID of the network segment DB row."},{"line_number":157,"context_line":""},{"line_number":158,"context_line":"        Optional method called from the mechanism drivers after delete_port"},{"line_number":159,"context_line":"        to remove the dynamic segment allocated for this port."}],"source_content_type":"text/x-python","patch_set":14,"id":"1abeadc6_f64dacc5","line":156,"updated":"2014-08-26 20:25:46.000000000","message":"Nit - remove \" DB row.\" - \"UUID of the network segment\" is sufficient.","commit_id":"9ba3a0125630fc177620e1ada2ebcbdac45b842b"},{"author":{"_account_id":1689,"name":"Robert Kukura","email":"rk@theep.net","username":"rkukura"},"change_message_id":"3e1cf5cb752f835bdfb3e708323921554785bbbb","unresolved":false,"context_lines":[{"line_number":156,"context_line":"        :param segment_id: UUID of the network segment DB row."},{"line_number":157,"context_line":""},{"line_number":158,"context_line":"        Optional method called from the mechanism drivers after delete_port"},{"line_number":159,"context_line":"        to remove the dynamic segment allocated for this port."},{"line_number":160,"context_line":"        \"\"\""},{"line_number":161,"context_line":"        pass"},{"line_number":162,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"1abeadc6_765a7c84","line":159,"updated":"2014-08-26 20:25:46.000000000","message":"The text above is too specific. It could be called in update_port() as well, such as when the port becomes unbound, or on seeing that there are other unused dynamic segments in addition to the ones that are bound.\n\nMaybe something like:\n\nCalled inside transaction context on session when a dynamic segment allocated for the port\u0027s network is no longer needed.","commit_id":"9ba3a0125630fc177620e1ada2ebcbdac45b842b"},{"author":{"_account_id":1689,"name":"Robert Kukura","email":"rk@theep.net","username":"rkukura"},"change_message_id":"3e1cf5cb752f835bdfb3e708323921554785bbbb","unresolved":false,"context_lines":[{"line_number":158,"context_line":"        Optional method called from the mechanism drivers after delete_port"},{"line_number":159,"context_line":"        to remove the dynamic segment allocated for this port."},{"line_number":160,"context_line":"        \"\"\""},{"line_number":161,"context_line":"        pass"},{"line_number":162,"context_line":""},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"@six.add_metaclass(abc.ABCMeta)"}],"source_content_type":"text/x-python","patch_set":14,"id":"1abeadc6_c139cc40","line":161,"updated":"2014-08-26 20:25:46.000000000","message":"Why is the TypeDriver.release_dynamic_segment() method even needed? It seems we could just use the existing release_segment() method. The drivers don\u0027t do anything different to return the segment to the pool, do they?\n\nNote that, if this method does need to be separate, it should be passed the segment dicitionary, just like release_segment(). The TypeManager can take care of looking up the segment_id to get this dictionary.","commit_id":"9ba3a0125630fc177620e1ada2ebcbdac45b842b"},{"author":{"_account_id":1689,"name":"Robert Kukura","email":"rk@theep.net","username":"rkukura"},"change_message_id":"14e5c34c545e0bb3e5cb63bf0b70fbea9e7035fc","unresolved":false,"context_lines":[{"line_number":159,"context_line":"        to remove the dynamic segment allocated for this port."},{"line_number":160,"context_line":"        \"\"\""},{"line_number":161,"context_line":"        pass"},{"line_number":162,"context_line":""},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"@six.add_metaclass(abc.ABCMeta)"},{"line_number":165,"context_line":"class NetworkContext(object):"}],"source_content_type":"text/x-python","patch_set":14,"id":"1abeadc6_472f8c3e","line":162,"updated":"2014-08-26 21:47:39.000000000","message":"Just realized allocate_dynamic_segment() and release_dynamic_segment() aren\u0027t used anymore. Lines 139-162 are left-over from a previous version, and should be removed.","commit_id":"9ba3a0125630fc177620e1ada2ebcbdac45b842b"},{"author":{"_account_id":1689,"name":"Robert Kukura","email":"rk@theep.net","username":"rkukura"},"change_message_id":"3e1cf5cb752f835bdfb3e708323921554785bbbb","unresolved":false,"context_lines":[{"line_number":351,"context_line":"        identify an item in network.network_segments."},{"line_number":352,"context_line":"        \"\"\""},{"line_number":353,"context_line":"        pass"},{"line_number":354,"context_line":""},{"line_number":355,"context_line":"    def allocate_dynamic_segment(self, segment):"},{"line_number":356,"context_line":"        \"\"\"Allocate a dynamic segment for the port.\"\"\""},{"line_number":357,"context_line":"        pass"}],"source_content_type":"text/x-python","patch_set":14,"id":"1abeadc6_a101303b","line":354,"updated":"2014-08-26 20:25:46.000000000","message":"The @abc.abstractmethod decorator is missing.","commit_id":"9ba3a0125630fc177620e1ada2ebcbdac45b842b"},{"author":{"_account_id":1689,"name":"Robert Kukura","email":"rk@theep.net","username":"rkukura"},"change_message_id":"3e1cf5cb752f835bdfb3e708323921554785bbbb","unresolved":false,"context_lines":[{"line_number":354,"context_line":""},{"line_number":355,"context_line":"    def allocate_dynamic_segment(self, segment):"},{"line_number":356,"context_line":"        \"\"\"Allocate a dynamic segment for the port.\"\"\""},{"line_number":357,"context_line":"        pass"},{"line_number":358,"context_line":""},{"line_number":359,"context_line":""},{"line_number":360,"context_line":"@six.add_metaclass(abc.ABCMeta)"}],"source_content_type":"text/x-python","patch_set":14,"id":"1abeadc6_41ca1c1b","line":357,"updated":"2014-08-26 20:25:46.000000000","message":"We seem to be missing release_dynamic_segment(self, segment_id) which is implemented in driver_context.py.","commit_id":"9ba3a0125630fc177620e1ada2ebcbdac45b842b"}],"neutron/plugins/ml2/managers.py":[{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"f9cbb121e9069f268ff8c07696b5ded9fe201da7","unresolved":false,"context_lines":[{"line_number":221,"context_line":"                    session, segment)"},{"line_number":222,"context_line":"                db.add_network_segment(session, network_id, dynamic_segment,"},{"line_number":223,"context_line":"                                       dynamic_segment\u003dTrue)"},{"line_number":224,"context_line":"                return dynamic_segment"},{"line_number":225,"context_line":""},{"line_number":226,"context_line":""},{"line_number":227,"context_line":"class MechanismManager(stevedore.named.NamedExtensionManager):"}],"source_content_type":"text/x-python","patch_set":8,"id":"1abeadc6_d5b86aca","line":224,"updated":"2014-08-20 20:17:20.000000000","message":"This dict will not have a api.DYNAMIC_SEGMENT field, which differs from the dict returned at line 215. Hence my comment in db.py asking if this field is actually needed. The caller already knows they are dealing with a dynamic segment.","commit_id":"d18606a72f6b8dd9a3b63b22f736af02121c7f56"},{"author":{"_account_id":107,"name":"Arvind Somya","email":"arvind.somya@gmail.com","username":"asomya"},"change_message_id":"27a1a0d574ec40a42d83de14704ddcb9c489dbd0","unresolved":false,"context_lines":[{"line_number":221,"context_line":"                    session, segment)"},{"line_number":222,"context_line":"                db.add_network_segment(session, network_id, dynamic_segment,"},{"line_number":223,"context_line":"                                       dynamic_segment\u003dTrue)"},{"line_number":224,"context_line":"                return dynamic_segment"},{"line_number":225,"context_line":""},{"line_number":226,"context_line":""},{"line_number":227,"context_line":"class MechanismManager(stevedore.named.NamedExtensionManager):"}],"source_content_type":"text/x-python","patch_set":8,"id":"1abeadc6_3b9d0d5a","line":224,"in_reply_to":"1abeadc6_d5b86aca","updated":"2014-08-20 20:35:46.000000000","message":"Done","commit_id":"d18606a72f6b8dd9a3b63b22f736af02121c7f56"},{"author":{"_account_id":1689,"name":"Robert Kukura","email":"rk@theep.net","username":"rkukura"},"change_message_id":"9dc5ba3137cff86a8513a3ecb07c5548d397ad8c","unresolved":false,"context_lines":[{"line_number":209,"context_line":"    def allocate_dynamic_segment(self, session, network_id, segment):"},{"line_number":210,"context_line":"        \"\"\"Allocate a dynamic segment using a partial segment dict.\"\"\""},{"line_number":211,"context_line":"        dynamic_segment \u003d db.get_dynamic_segment("},{"line_number":212,"context_line":"            session, network_id, segment.get(api.PHYSICAL_NETWORK))"},{"line_number":213,"context_line":""},{"line_number":214,"context_line":"        if dynamic_segment:"},{"line_number":215,"context_line":"            return dynamic_segment"}],"source_content_type":"text/x-python","patch_set":9,"id":"1abeadc6_b76bbb83","line":212,"updated":"2014-08-22 16:29:46.000000000","message":"db.get_dynamic_segment() needs to find an existing segment, if it exists, that matches whatever properties are specified in the segment param. Don\u0027t forget that for VDP, we\u0027ll be looking for (or creating) a dynamic VLAN_VDP segment with both a specific physical_network (identifiying the switch) and a specific segmentation_id (used to identify the network in the VDP negotiation). I think db.get_dynanic_segment() will need to build up its query based on which properties are set in segment.","commit_id":"d6b7daafd411069a7e3fe974dba5481ed85a781d"},{"author":{"_account_id":107,"name":"Arvind Somya","email":"arvind.somya@gmail.com","username":"asomya"},"change_message_id":"0777e6b6fa4edd7077b68585714e7e1d19b0211a","unresolved":false,"context_lines":[{"line_number":209,"context_line":"    def allocate_dynamic_segment(self, session, network_id, segment):"},{"line_number":210,"context_line":"        \"\"\"Allocate a dynamic segment using a partial segment dict.\"\"\""},{"line_number":211,"context_line":"        dynamic_segment \u003d db.get_dynamic_segment("},{"line_number":212,"context_line":"            session, network_id, segment.get(api.PHYSICAL_NETWORK))"},{"line_number":213,"context_line":""},{"line_number":214,"context_line":"        if dynamic_segment:"},{"line_number":215,"context_line":"            return dynamic_segment"}],"source_content_type":"text/x-python","patch_set":9,"id":"1abeadc6_f2b1aa47","line":212,"in_reply_to":"1abeadc6_b76bbb83","updated":"2014-08-22 17:44:53.000000000","message":"Done, i modified the DB method and caller to supply segmentation id as well.","commit_id":"d6b7daafd411069a7e3fe974dba5481ed85a781d"},{"author":{"_account_id":1689,"name":"Robert Kukura","email":"rk@theep.net","username":"rkukura"},"change_message_id":"9dc5ba3137cff86a8513a3ecb07c5548d397ad8c","unresolved":false,"context_lines":[{"line_number":216,"context_line":""},{"line_number":217,"context_line":"        for network_type in self.drivers:"},{"line_number":218,"context_line":"            if network_type \u003d\u003d segment.get(api.NETWORK_TYPE):"},{"line_number":219,"context_line":"                driver \u003d self.drivers.get(network_type)"},{"line_number":220,"context_line":"                dynamic_segment \u003d driver.obj.reserve_provider_segment("},{"line_number":221,"context_line":"                    session, segment)"},{"line_number":222,"context_line":"                db.add_network_segment(session, network_id, dynamic_segment,"}],"source_content_type":"text/x-python","patch_set":9,"id":"1abeadc6_779923c3","line":219,"updated":"2014-08-22 16:29:46.000000000","message":"The above three lines can be replaced with:\n\ndriver \u003d self.drivers.get(segment.get(api.NETWORK_TYPE))","commit_id":"d6b7daafd411069a7e3fe974dba5481ed85a781d"},{"author":{"_account_id":107,"name":"Arvind Somya","email":"arvind.somya@gmail.com","username":"asomya"},"change_message_id":"0777e6b6fa4edd7077b68585714e7e1d19b0211a","unresolved":false,"context_lines":[{"line_number":216,"context_line":""},{"line_number":217,"context_line":"        for network_type in self.drivers:"},{"line_number":218,"context_line":"            if network_type \u003d\u003d segment.get(api.NETWORK_TYPE):"},{"line_number":219,"context_line":"                driver \u003d self.drivers.get(network_type)"},{"line_number":220,"context_line":"                dynamic_segment \u003d driver.obj.reserve_provider_segment("},{"line_number":221,"context_line":"                    session, segment)"},{"line_number":222,"context_line":"                db.add_network_segment(session, network_id, dynamic_segment,"}],"source_content_type":"text/x-python","patch_set":9,"id":"1abeadc6_72859a58","line":219,"in_reply_to":"1abeadc6_779923c3","updated":"2014-08-22 17:44:53.000000000","message":"Done","commit_id":"d6b7daafd411069a7e3fe974dba5481ed85a781d"},{"author":{"_account_id":1689,"name":"Robert Kukura","email":"rk@theep.net","username":"rkukura"},"change_message_id":"0747867a77337bc3f569e399352475a8b0f158dd","unresolved":false,"context_lines":[{"line_number":227,"context_line":"            session, network_id, segment.get(api.PHYSICAL_NETWORK),"},{"line_number":228,"context_line":"            segment.get(api.SEGMENTATION_ID))"},{"line_number":229,"context_line":"        driver \u003d self.drivers.get(segment.get(api.NETWORK_TYPE))"},{"line_number":230,"context_line":"        dynamic_segment \u003d driver.obj.release_segment(session, dynamic_segment)"},{"line_number":231,"context_line":"        db.release_dynamic_segment("},{"line_number":232,"context_line":"            session, network_id, dynamic_segment.get(api.PHYSICAL_NETWORK),"},{"line_number":233,"context_line":"            dynamic_segment.get(api.SEGMENTATION_ID))"}],"source_content_type":"text/x-python","patch_set":13,"id":"1abeadc6_31ed9c8c","line":230,"updated":"2014-08-25 21:03:06.000000000","message":"I was getting UT failures that I tracked down to None being returned here. I don\u0027t think assignment of the result from the driver to dynamic_segment is needed here.","commit_id":"818c1b9009a56585a2cdb0d877e9532d97dd67af"},{"author":{"_account_id":107,"name":"Arvind Somya","email":"arvind.somya@gmail.com","username":"asomya"},"change_message_id":"e36b22bf390a2d769249bd6ffb8a684c5633e3b6","unresolved":false,"context_lines":[{"line_number":227,"context_line":"            session, network_id, segment.get(api.PHYSICAL_NETWORK),"},{"line_number":228,"context_line":"            segment.get(api.SEGMENTATION_ID))"},{"line_number":229,"context_line":"        driver \u003d self.drivers.get(segment.get(api.NETWORK_TYPE))"},{"line_number":230,"context_line":"        dynamic_segment \u003d driver.obj.release_segment(session, dynamic_segment)"},{"line_number":231,"context_line":"        db.release_dynamic_segment("},{"line_number":232,"context_line":"            session, network_id, dynamic_segment.get(api.PHYSICAL_NETWORK),"},{"line_number":233,"context_line":"            dynamic_segment.get(api.SEGMENTATION_ID))"}],"source_content_type":"text/x-python","patch_set":13,"id":"1abeadc6_6ccadb6f","line":230,"in_reply_to":"1abeadc6_31ed9c8c","updated":"2014-08-25 21:21:47.000000000","message":"Done","commit_id":"818c1b9009a56585a2cdb0d877e9532d97dd67af"},{"author":{"_account_id":1689,"name":"Robert Kukura","email":"rk@theep.net","username":"rkukura"},"change_message_id":"46f135c0ee2652f62616d5360df14b4a587c6ac6","unresolved":false,"context_lines":[{"line_number":205,"context_line":"                            \"network type is not supported.\"), segment)"},{"line_number":206,"context_line":""},{"line_number":207,"context_line":"        for segment in dynamic_segments:"},{"line_number":208,"context_line":"            self.release_dynamic_segment(session, segment.get(api.ID))"},{"line_number":209,"context_line":""},{"line_number":210,"context_line":"    def allocate_dynamic_segment(self, session, network_id, segment):"},{"line_number":211,"context_line":"        \"\"\"Allocate a dynamic segment using a partial or full segment dict.\"\"\""}],"source_content_type":"text/x-python","patch_set":15,"id":"1abeadc6_f36d9505","line":208,"updated":"2014-08-27 15:38:10.000000000","message":"This function can be simplified and made more efficient. Its not necessary to explicitly delete the dynamic segments from the DB, since they will be deleted via cascade just like the static segments. This means there is no need to query separately for the static and dynamic segments, or to treat them differently. You could just call db.get_network_segments(session, network_id, filter_dynamic\u003dNone) [see my comment on db.py], then call driver.obj.release_segment(session, segment) for each.","commit_id":"316c0e8763426c9ef5786a7b71c7d5cc47465a1a"},{"author":{"_account_id":107,"name":"Arvind Somya","email":"arvind.somya@gmail.com","username":"asomya"},"change_message_id":"7f54807f3e494e62e2aed7decb9dc201a6466e5e","unresolved":false,"context_lines":[{"line_number":205,"context_line":"                            \"network type is not supported.\"), segment)"},{"line_number":206,"context_line":""},{"line_number":207,"context_line":"        for segment in dynamic_segments:"},{"line_number":208,"context_line":"            self.release_dynamic_segment(session, segment.get(api.ID))"},{"line_number":209,"context_line":""},{"line_number":210,"context_line":"    def allocate_dynamic_segment(self, session, network_id, segment):"},{"line_number":211,"context_line":"        \"\"\"Allocate a dynamic segment using a partial or full segment dict.\"\"\""}],"source_content_type":"text/x-python","patch_set":15,"id":"1abeadc6_ae9574e5","line":208,"in_reply_to":"1abeadc6_f36d9505","updated":"2014-08-27 16:07:48.000000000","message":"Done","commit_id":"316c0e8763426c9ef5786a7b71c7d5cc47465a1a"},{"author":{"_account_id":1689,"name":"Robert Kukura","email":"rk@theep.net","username":"rkukura"},"change_message_id":"46f135c0ee2652f62616d5360df14b4a587c6ac6","unresolved":false,"context_lines":[{"line_number":230,"context_line":"            driver.obj.release_segment(session, segment)"},{"line_number":231,"context_line":"            db.release_dynamic_segment(session, segment_id)"},{"line_number":232,"context_line":"        else:"},{"line_number":233,"context_line":"            LOG.debug(\"No segment found with id %(segment_id)s\", segment_id)"},{"line_number":234,"context_line":""},{"line_number":235,"context_line":""},{"line_number":236,"context_line":"class MechanismManager(stevedore.named.NamedExtensionManager):"}],"source_content_type":"text/x-python","patch_set":15,"id":"1abeadc6_ee584cfc","line":233,"updated":"2014-08-27 15:38:10.000000000","message":"This should be a LOG.error() with the same text as on line 204.","commit_id":"316c0e8763426c9ef5786a7b71c7d5cc47465a1a"},{"author":{"_account_id":107,"name":"Arvind Somya","email":"arvind.somya@gmail.com","username":"asomya"},"change_message_id":"7f54807f3e494e62e2aed7decb9dc201a6466e5e","unresolved":false,"context_lines":[{"line_number":230,"context_line":"            driver.obj.release_segment(session, segment)"},{"line_number":231,"context_line":"            db.release_dynamic_segment(session, segment_id)"},{"line_number":232,"context_line":"        else:"},{"line_number":233,"context_line":"            LOG.debug(\"No segment found with id %(segment_id)s\", segment_id)"},{"line_number":234,"context_line":""},{"line_number":235,"context_line":""},{"line_number":236,"context_line":"class MechanismManager(stevedore.named.NamedExtensionManager):"}],"source_content_type":"text/x-python","patch_set":15,"id":"1abeadc6_ce98f01d","line":233,"in_reply_to":"1abeadc6_ee584cfc","updated":"2014-08-27 16:07:48.000000000","message":"Done","commit_id":"316c0e8763426c9ef5786a7b71c7d5cc47465a1a"},{"author":{"_account_id":1689,"name":"Robert Kukura","email":"rk@theep.net","username":"rkukura"},"change_message_id":"9714193db657f67cda59a58dfd54e7430b077ec5","unresolved":false,"context_lines":[{"line_number":226,"context_line":"            driver \u003d self.drivers.get(segment.get(api.NETWORK_TYPE))"},{"line_number":227,"context_line":"            if driver:"},{"line_number":228,"context_line":"                driver.obj.release_segment(session, segment)"},{"line_number":229,"context_line":"                db.release_dynamic_segment(session, segment_id)"},{"line_number":230,"context_line":"            else:"},{"line_number":231,"context_line":"                LOG.error(_(\"Failed to release segment \u0027%s\u0027 because \""},{"line_number":232,"context_line":"                            \"network type is not supported.\"), segment)"}],"source_content_type":"text/x-python","patch_set":16,"id":"1abeadc6_09401da4","line":229,"updated":"2014-08-27 18:34:06.000000000","message":"See my comment on db.py about renaming release_dynamic_segment() to either delete_segment() or remove_segment(). To me, \"release\" means \"return to the pool\", which is handled by line 228.","commit_id":"30cc1b4ac4a7f361222176fc53ae082423476ec0"},{"author":{"_account_id":107,"name":"Arvind Somya","email":"arvind.somya@gmail.com","username":"asomya"},"change_message_id":"4cea7a97512bb8091ffd3afb0743b227044441fc","unresolved":false,"context_lines":[{"line_number":226,"context_line":"            driver \u003d self.drivers.get(segment.get(api.NETWORK_TYPE))"},{"line_number":227,"context_line":"            if driver:"},{"line_number":228,"context_line":"                driver.obj.release_segment(session, segment)"},{"line_number":229,"context_line":"                db.release_dynamic_segment(session, segment_id)"},{"line_number":230,"context_line":"            else:"},{"line_number":231,"context_line":"                LOG.error(_(\"Failed to release segment \u0027%s\u0027 because \""},{"line_number":232,"context_line":"                            \"network type is not supported.\"), segment)"}],"source_content_type":"text/x-python","patch_set":16,"id":"1abeadc6_4ce223a1","line":229,"in_reply_to":"1abeadc6_09401da4","updated":"2014-08-27 19:04:02.000000000","message":"Done","commit_id":"30cc1b4ac4a7f361222176fc53ae082423476ec0"}],"neutron/plugins/ml2/models.py":[{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"4fd01e15c621735b109bc855a3b1ea4203cb2753","unresolved":false,"context_lines":[{"line_number":14,"context_line":"#    under the License."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"import sqlalchemy as sa"},{"line_number":17,"context_line":"from sqlalchemy import orm, sql"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"from neutron.db import model_base"},{"line_number":20,"context_line":"from neutron.db import models_v2"}],"source_content_type":"text/x-python","patch_set":8,"id":"1abeadc6_bd967f3d","line":17,"updated":"2014-08-20 15:33:42.000000000","message":"I think the convention is to use one import per line.","commit_id":"d18606a72f6b8dd9a3b63b22f736af02121c7f56"},{"author":{"_account_id":107,"name":"Arvind Somya","email":"arvind.somya@gmail.com","username":"asomya"},"change_message_id":"27a1a0d574ec40a42d83de14704ddcb9c489dbd0","unresolved":false,"context_lines":[{"line_number":14,"context_line":"#    under the License."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"import sqlalchemy as sa"},{"line_number":17,"context_line":"from sqlalchemy import orm, sql"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"from neutron.db import model_base"},{"line_number":20,"context_line":"from neutron.db import models_v2"}],"source_content_type":"text/x-python","patch_set":8,"id":"1abeadc6_5bcc896a","line":17,"in_reply_to":"1abeadc6_bd967f3d","updated":"2014-08-20 20:35:46.000000000","message":"Done","commit_id":"d18606a72f6b8dd9a3b63b22f736af02121c7f56"},{"author":{"_account_id":12737,"name":"Jacek Swiderski","email":"jacek.swiderski@codilime.com","username":"Altran"},"change_message_id":"8232670691e9c8a8a45fe018722cc1ca19c2ea2b","unresolved":false,"context_lines":[{"line_number":40,"context_line":"    physical_network \u003d sa.Column(sa.String(64))"},{"line_number":41,"context_line":"    segmentation_id \u003d sa.Column(sa.Integer)"},{"line_number":42,"context_line":"    dynamic_segment \u003d sa.Column(sa.Boolean, default\u003dFalse,"},{"line_number":43,"context_line":"                                server_default\u003dsa.sql.false())"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"class PortBinding(model_base.BASEV2):"}],"source_content_type":"text/x-python","patch_set":9,"id":"1abeadc6_3bb89bc7","line":43,"updated":"2014-08-21 09:15:57.000000000","message":"I thought this is only required in migrations but I might be wrong","commit_id":"d6b7daafd411069a7e3fe974dba5481ed85a781d"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"17f9d8d207c89070129a19f7c5b51aa87dc7de7e","unresolved":false,"context_lines":[{"line_number":40,"context_line":"    physical_network \u003d sa.Column(sa.String(64))"},{"line_number":41,"context_line":"    segmentation_id \u003d sa.Column(sa.Integer)"},{"line_number":42,"context_line":"    dynamic_segment \u003d sa.Column(sa.Boolean, default\u003dFalse,"},{"line_number":43,"context_line":"                                server_default\u003dsa.sql.false())"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"class PortBinding(model_base.BASEV2):"}],"source_content_type":"text/x-python","patch_set":9,"id":"1abeadc6_4de2ef2f","line":43,"in_reply_to":"1abeadc6_3bb89bc7","updated":"2014-08-21 16:05:19.000000000","message":"It\u0027s better to keep models and migrations in sync.","commit_id":"d6b7daafd411069a7e3fe974dba5481ed85a781d"},{"author":{"_account_id":7249,"name":"Ann Taraday","email":"akamyshnikova@mirantis.com","username":"AKamyshnikova"},"change_message_id":"5366d80a3b379365c11004f5b1e47a25b0dbacaf","unresolved":false,"context_lines":[{"line_number":40,"context_line":"    physical_network \u003d sa.Column(sa.String(64))"},{"line_number":41,"context_line":"    segmentation_id \u003d sa.Column(sa.Integer)"},{"line_number":42,"context_line":"    dynamic_segment \u003d sa.Column(sa.Boolean, default\u003dFalse,"},{"line_number":43,"context_line":"                                server_default\u003dsa.sql.false())"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"class PortBinding(model_base.BASEV2):"}],"source_content_type":"text/x-python","patch_set":9,"id":"1abeadc6_febd08d9","line":43,"in_reply_to":"1abeadc6_4de2ef2f","updated":"2014-08-22 08:36:34.000000000","message":"Yes, it is needed to at server_default in models for models and migrations synchronization.","commit_id":"d6b7daafd411069a7e3fe974dba5481ed85a781d"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"932b50d4baa8f43684027820befed91dbe2888d4","unresolved":false,"context_lines":[{"line_number":40,"context_line":"    physical_network \u003d sa.Column(sa.String(64))"},{"line_number":41,"context_line":"    segmentation_id \u003d sa.Column(sa.Integer)"},{"line_number":42,"context_line":"    dynamic_segment \u003d sa.Column(sa.Boolean, default\u003dFalse,"},{"line_number":43,"context_line":"                                server_default\u003dsa.sql.false())"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"class PortBinding(model_base.BASEV2):"}],"source_content_type":"text/x-python","patch_set":9,"id":"1abeadc6_5f118c50","line":43,"in_reply_to":"1abeadc6_febd08d9","updated":"2014-08-22 14:40:04.000000000","message":"You also need to add nullable\u003dFalse.","commit_id":"d6b7daafd411069a7e3fe974dba5481ed85a781d"},{"author":{"_account_id":1689,"name":"Robert Kukura","email":"rk@theep.net","username":"rkukura"},"change_message_id":"9714193db657f67cda59a58dfd54e7430b077ec5","unresolved":false,"context_lines":[{"line_number":39,"context_line":"    network_type \u003d sa.Column(sa.String(32), nullable\u003dFalse)"},{"line_number":40,"context_line":"    physical_network \u003d sa.Column(sa.String(64))"},{"line_number":41,"context_line":"    segmentation_id \u003d sa.Column(sa.Integer)"},{"line_number":42,"context_line":"    dynamic_segment \u003d sa.Column(sa.Boolean, default\u003dFalse, nullable\u003dFalse,"},{"line_number":43,"context_line":"                                server_default\u003dsa.sql.false())"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"1abeadc6_cc0c73ef","line":42,"updated":"2014-08-27 18:34:06.000000000","message":"This is just a nit - feel free to ignore it. The column name \"dynamic_segment\" sounds to me like it is a segment or identifies a segment, whereas this column is really just saying whether this segment is dynamic or not. Please consider renaming it to \"dynamic\" or \"is_dynamic\".","commit_id":"30cc1b4ac4a7f361222176fc53ae082423476ec0"},{"author":{"_account_id":107,"name":"Arvind Somya","email":"arvind.somya@gmail.com","username":"asomya"},"change_message_id":"4cea7a97512bb8091ffd3afb0743b227044441fc","unresolved":false,"context_lines":[{"line_number":39,"context_line":"    network_type \u003d sa.Column(sa.String(32), nullable\u003dFalse)"},{"line_number":40,"context_line":"    physical_network \u003d sa.Column(sa.String(64))"},{"line_number":41,"context_line":"    segmentation_id \u003d sa.Column(sa.Integer)"},{"line_number":42,"context_line":"    dynamic_segment \u003d sa.Column(sa.Boolean, default\u003dFalse, nullable\u003dFalse,"},{"line_number":43,"context_line":"                                server_default\u003dsa.sql.false())"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"1abeadc6_3711b052","line":42,"in_reply_to":"1abeadc6_cc0c73ef","updated":"2014-08-27 19:04:02.000000000","message":"Done","commit_id":"30cc1b4ac4a7f361222176fc53ae082423476ec0"}],"neutron/tests/unit/ml2/test_ml2_plugin.py":[{"author":{"_account_id":1689,"name":"Robert Kukura","email":"rk@theep.net","username":"rkukura"},"change_message_id":"2af100607cd708d271a75c4d12b4b52c7354fe53","unresolved":false,"context_lines":[{"line_number":389,"context_line":"        self.assertEqual(\u0027vlan\u0027, dynamic_segment[driver_api.NETWORK_TYPE])"},{"line_number":390,"context_line":"        self.assertEqual(\u0027physnet3\u0027,"},{"line_number":391,"context_line":"                         dynamic_segment[driver_api.PHYSICAL_NETWORK])"},{"line_number":392,"context_line":"        self.assertEqual(dynamic_segment[driver_api.SEGMENTATION_ID], 1234)"},{"line_number":393,"context_line":""},{"line_number":394,"context_line":"    def test_allocate_dynamic_segment_multiple_physnets(self):"},{"line_number":395,"context_line":"        data \u003d {\u0027network\u0027: {\u0027name\u0027: \u0027net1\u0027,"}],"source_content_type":"text/x-python","patch_set":12,"id":"1abeadc6_d1e715ab","line":392,"updated":"2014-08-25 15:24:27.000000000","message":"Should test release_dynamic_segment() as well, if that gets added.","commit_id":"c82ca87784e9c5d10154ebec84c7763055ebebea"},{"author":{"_account_id":107,"name":"Arvind Somya","email":"arvind.somya@gmail.com","username":"asomya"},"change_message_id":"715dbaef0fe857f01c2e27809235960b17546835","unresolved":false,"context_lines":[{"line_number":389,"context_line":"        self.assertEqual(\u0027vlan\u0027, dynamic_segment[driver_api.NETWORK_TYPE])"},{"line_number":390,"context_line":"        self.assertEqual(\u0027physnet3\u0027,"},{"line_number":391,"context_line":"                         dynamic_segment[driver_api.PHYSICAL_NETWORK])"},{"line_number":392,"context_line":"        self.assertEqual(dynamic_segment[driver_api.SEGMENTATION_ID], 1234)"},{"line_number":393,"context_line":""},{"line_number":394,"context_line":"    def test_allocate_dynamic_segment_multiple_physnets(self):"},{"line_number":395,"context_line":"        data \u003d {\u0027network\u0027: {\u0027name\u0027: \u0027net1\u0027,"}],"source_content_type":"text/x-python","patch_set":12,"id":"1abeadc6_c211055f","line":392,"in_reply_to":"1abeadc6_d1e715ab","updated":"2014-08-25 16:27:37.000000000","message":"Done","commit_id":"c82ca87784e9c5d10154ebec84c7763055ebebea"},{"author":{"_account_id":1689,"name":"Robert Kukura","email":"rk@theep.net","username":"rkukura"},"change_message_id":"0747867a77337bc3f569e399352475a8b0f158dd","unresolved":false,"context_lines":[{"line_number":442,"context_line":"        self.assertEqual(\u0027vlan\u0027, dynamic_segment[driver_api.NETWORK_TYPE])"},{"line_number":443,"context_line":"        self.assertEqual(\u0027physnet1\u0027,"},{"line_number":444,"context_line":"                         dynamic_segment[driver_api.PHYSICAL_NETWORK])"},{"line_number":445,"context_line":"        dynamic_segment_id \u003d dynamic_segment[driver_api.SEGMENTATION_ID]"},{"line_number":446,"context_line":"        self.assertTrue(dynamic_segment_id \u003e 0)"},{"line_number":447,"context_line":"        segment[driver_api.SEGMENTATION_ID] \u003d dynamic_segment_id"},{"line_number":448,"context_line":"        self.driver.type_manager.release_dynamic_segment("}],"source_content_type":"text/x-python","patch_set":13,"id":"1abeadc6_06e8687b","line":445,"updated":"2014-08-25 21:03:06.000000000","message":"Please call \u0027dynamic_segment_id\u0027 something like \u0027segmentation_id\u0027 to avoid confusion with the segment\u0027s own ID (its UUID). Again, I\u0027d prefer to release segments by their IDs instead of matching properties.","commit_id":"818c1b9009a56585a2cdb0d877e9532d97dd67af"},{"author":{"_account_id":107,"name":"Arvind Somya","email":"arvind.somya@gmail.com","username":"asomya"},"change_message_id":"e36b22bf390a2d769249bd6ffb8a684c5633e3b6","unresolved":false,"context_lines":[{"line_number":442,"context_line":"        self.assertEqual(\u0027vlan\u0027, dynamic_segment[driver_api.NETWORK_TYPE])"},{"line_number":443,"context_line":"        self.assertEqual(\u0027physnet1\u0027,"},{"line_number":444,"context_line":"                         dynamic_segment[driver_api.PHYSICAL_NETWORK])"},{"line_number":445,"context_line":"        dynamic_segment_id \u003d dynamic_segment[driver_api.SEGMENTATION_ID]"},{"line_number":446,"context_line":"        self.assertTrue(dynamic_segment_id \u003e 0)"},{"line_number":447,"context_line":"        segment[driver_api.SEGMENTATION_ID] \u003d dynamic_segment_id"},{"line_number":448,"context_line":"        self.driver.type_manager.release_dynamic_segment("}],"source_content_type":"text/x-python","patch_set":13,"id":"1abeadc6_0cab278a","line":445,"in_reply_to":"1abeadc6_06e8687b","updated":"2014-08-25 21:21:47.000000000","message":"I\u0027ll change that, the UT has been fixed with the complete segment dict with the id populated. See my comments in driver_api.py","commit_id":"818c1b9009a56585a2cdb0d877e9532d97dd67af"},{"author":{"_account_id":1689,"name":"Robert Kukura","email":"rk@theep.net","username":"rkukura"},"change_message_id":"28883123d52d59ad0c49bf7f566a12dda095700a","unresolved":false,"context_lines":[{"line_number":442,"context_line":"        self.assertEqual(\u0027vlan\u0027, dynamic_segment[driver_api.NETWORK_TYPE])"},{"line_number":443,"context_line":"        self.assertEqual(\u0027physnet1\u0027,"},{"line_number":444,"context_line":"                         dynamic_segment[driver_api.PHYSICAL_NETWORK])"},{"line_number":445,"context_line":"        dynamic_segment_id \u003d dynamic_segment[driver_api.SEGMENTATION_ID]"},{"line_number":446,"context_line":"        self.assertTrue(dynamic_segment_id \u003e 0)"},{"line_number":447,"context_line":"        segment[driver_api.SEGMENTATION_ID] \u003d dynamic_segment_id"},{"line_number":448,"context_line":"        self.driver.type_manager.release_dynamic_segment("}],"source_content_type":"text/x-python","patch_set":13,"id":"1abeadc6_00d68bc5","line":445,"in_reply_to":"1abeadc6_0cab278a","updated":"2014-08-25 22:04:29.000000000","message":"Again, I\u0027d just pass the segment ID to release_segment(). Anything else is redundant.","commit_id":"818c1b9009a56585a2cdb0d877e9532d97dd67af"},{"author":{"_account_id":1689,"name":"Robert Kukura","email":"rk@theep.net","username":"rkukura"},"change_message_id":"46f135c0ee2652f62616d5360df14b4a587c6ac6","unresolved":false,"context_lines":[{"line_number":566,"context_line":"        res \u003d network_req.get_response(self.api)"},{"line_number":567,"context_line":"        self.assertEqual(201, res.status_int)"},{"line_number":568,"context_line":""},{"line_number":569,"context_line":"    def test_release_network_segments(self):"},{"line_number":570,"context_line":"        data \u003d {\u0027network\u0027: {\u0027name\u0027: \u0027net1\u0027,"},{"line_number":571,"context_line":"                            \u0027admin_state_up\u0027: True,"},{"line_number":572,"context_line":"                            \u0027shared\u0027: False,"}],"source_content_type":"text/x-python","patch_set":15,"id":"1abeadc6_6e20bcf7","line":569,"updated":"2014-08-27 15:38:10.000000000","message":"If this UT replaces the test_release_segment_no_type_driver() UT, it needs to also verify that the proper error is logged when the driver is not found. Maybe you should restore that test, but fix it to work with the new way of releasing the segments.","commit_id":"316c0e8763426c9ef5786a7b71c7d5cc47465a1a"},{"author":{"_account_id":107,"name":"Arvind Somya","email":"arvind.somya@gmail.com","username":"asomya"},"change_message_id":"7f54807f3e494e62e2aed7decb9dc201a6466e5e","unresolved":false,"context_lines":[{"line_number":566,"context_line":"        res \u003d network_req.get_response(self.api)"},{"line_number":567,"context_line":"        self.assertEqual(201, res.status_int)"},{"line_number":568,"context_line":""},{"line_number":569,"context_line":"    def test_release_network_segments(self):"},{"line_number":570,"context_line":"        data \u003d {\u0027network\u0027: {\u0027name\u0027: \u0027net1\u0027,"},{"line_number":571,"context_line":"                            \u0027admin_state_up\u0027: True,"},{"line_number":572,"context_line":"                            \u0027shared\u0027: False,"}],"source_content_type":"text/x-python","patch_set":15,"id":"1abeadc6_2e8964ca","line":569,"in_reply_to":"1abeadc6_6e20bcf7","updated":"2014-08-27 16:07:48.000000000","message":"Done","commit_id":"316c0e8763426c9ef5786a7b71c7d5cc47465a1a"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"150c679f634c4205798954d9df2e08bde86f1022","unresolved":false,"context_lines":[{"line_number":72,"context_line":"        self.vlan_range2 \u003d \u0027200:300\u0027"},{"line_number":73,"context_line":"        self.physnet2 \u003d \u0027physnet2\u0027"},{"line_number":74,"context_line":"        self.phys_vrange \u003d \u0027:\u0027.join([self.physnet, self.vlan_range])"},{"line_number":75,"context_line":"        self.phys2_vrange \u003d \u0027:\u0027.join([self.physnet2, self.vlan_range2])"},{"line_number":76,"context_line":"        config.cfg.CONF.set_override(\u0027network_vlan_ranges\u0027,"},{"line_number":77,"context_line":"                                     [self.phys_vrange, self.phys2_vrange],"},{"line_number":78,"context_line":"                                     group\u003d\u0027ml2_type_vlan\u0027)"}],"source_content_type":"text/x-python","patch_set":18,"id":"1abeadc6_2c4082a4","line":75,"updated":"2014-08-27 21:20:25.000000000","message":"if you have to make the change below then i\u0027d list all the original settings in a row then all the \"2\" versions. change phys2_vrange to phys_vrange2 to be consistent).","commit_id":"99f86e38e9a4b889ab85131cb3c6eeef5424cfaf"},{"author":{"_account_id":107,"name":"Arvind Somya","email":"arvind.somya@gmail.com","username":"asomya"},"change_message_id":"b094dd368acf207e1d213977e38d55623f28424f","unresolved":false,"context_lines":[{"line_number":72,"context_line":"        self.vlan_range2 \u003d \u0027200:300\u0027"},{"line_number":73,"context_line":"        self.physnet2 \u003d \u0027physnet2\u0027"},{"line_number":74,"context_line":"        self.phys_vrange \u003d \u0027:\u0027.join([self.physnet, self.vlan_range])"},{"line_number":75,"context_line":"        self.phys2_vrange \u003d \u0027:\u0027.join([self.physnet2, self.vlan_range2])"},{"line_number":76,"context_line":"        config.cfg.CONF.set_override(\u0027network_vlan_ranges\u0027,"},{"line_number":77,"context_line":"                                     [self.phys_vrange, self.phys2_vrange],"},{"line_number":78,"context_line":"                                     group\u003d\u0027ml2_type_vlan\u0027)"}],"source_content_type":"text/x-python","patch_set":18,"id":"1abeadc6_faa37440","line":75,"in_reply_to":"1abeadc6_2c4082a4","updated":"2014-08-28 18:00:53.000000000","message":"If i make any other changes, I\u0027ll change this too.","commit_id":"99f86e38e9a4b889ab85131cb3c6eeef5424cfaf"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"150c679f634c4205798954d9df2e08bde86f1022","unresolved":false,"context_lines":[{"line_number":619,"context_line":"                self.driver.type_manager.release_network_segments("},{"line_number":620,"context_line":"                    self.context.session, network_id)"},{"line_number":621,"context_line":""},{"line_number":622,"context_line":"                log.error.assert_called_once_with("},{"line_number":623,"context_line":"                    \"Failed to release segment \u0027%s\u0027 because \""},{"line_number":624,"context_line":"                    \"network type is not supported.\", segment)"},{"line_number":625,"context_line":""}],"source_content_type":"text/x-python","patch_set":18,"id":"1abeadc6_4cc85e55","line":622,"updated":"2014-08-27 21:20:25.000000000","message":"is this indented correctly?","commit_id":"99f86e38e9a4b889ab85131cb3c6eeef5424cfaf"},{"author":{"_account_id":107,"name":"Arvind Somya","email":"arvind.somya@gmail.com","username":"asomya"},"change_message_id":"b094dd368acf207e1d213977e38d55623f28424f","unresolved":false,"context_lines":[{"line_number":619,"context_line":"                self.driver.type_manager.release_network_segments("},{"line_number":620,"context_line":"                    self.context.session, network_id)"},{"line_number":621,"context_line":""},{"line_number":622,"context_line":"                log.error.assert_called_once_with("},{"line_number":623,"context_line":"                    \"Failed to release segment \u0027%s\u0027 because \""},{"line_number":624,"context_line":"                    \"network type is not supported.\", segment)"},{"line_number":625,"context_line":""}],"source_content_type":"text/x-python","patch_set":18,"id":"1abeadc6_daa6b853","line":622,"in_reply_to":"1abeadc6_4cc85e55","updated":"2014-08-28 18:00:53.000000000","message":"Yeah it\u0027s within the context.","commit_id":"99f86e38e9a4b889ab85131cb3c6eeef5424cfaf"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"59ed7b273d9f4a158598445404f30dff86c25049","unresolved":false,"context_lines":[{"line_number":619,"context_line":"                self.driver.type_manager.release_network_segments("},{"line_number":620,"context_line":"                    self.context.session, network_id)"},{"line_number":621,"context_line":""},{"line_number":622,"context_line":"                log.error.assert_called_once_with("},{"line_number":623,"context_line":"                    \"Failed to release segment \u0027%s\u0027 because \""},{"line_number":624,"context_line":"                    \"network type is not supported.\", segment)"},{"line_number":625,"context_line":""}],"source_content_type":"text/x-python","patch_set":18,"id":"1abeadc6_31987774","line":622,"in_reply_to":"1abeadc6_daa6b853","updated":"2014-08-29 20:34:17.000000000","message":"(Follow-up comment) Note that this does not need to be inside of with clause. \"log\" variable can be valid even after exiting with-clause. Exiting with clause means just mocking is stopped.","commit_id":"99f86e38e9a4b889ab85131cb3c6eeef5424cfaf"}]}
