)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"fc1950d2957c12586b2fa75d8720189b1045b76e","unresolved":false,"context_lines":[{"line_number":16,"context_line":""},{"line_number":17,"context_line":"This patch simply ensures the final check for active IP allocations is"},{"line_number":18,"context_line":"not performed for this class of subnets; since all IP allocations will"},{"line_number":19,"context_line":"be removed anyway, it does not make sense to check whether there all"},{"line_number":20,"context_line":"allocations at all. In fact, doing this check might cause a failure"},{"line_number":21,"context_line":"of the delete operation if an IP allocation is made concurrently."},{"line_number":22,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"1a930d6b_aea29348","line":19,"updated":"2015-01-26 12:04:10.000000000","message":"nit: I think last \u0027all\u0027 was supposed to be \u0027are\u0027 ?","commit_id":"e8943816ef13b89010669d277e5e7d95c761adb7"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"67dbfbc1558a31aeb0e41b6aef4ecff6adc27bd1","unresolved":false,"context_lines":[{"line_number":16,"context_line":""},{"line_number":17,"context_line":"This patch simply ensures the final check for active IP allocations is"},{"line_number":18,"context_line":"not performed for this class of subnets; since all IP allocations will"},{"line_number":19,"context_line":"be removed anyway, it does not make sense to check whether there all"},{"line_number":20,"context_line":"allocations at all. In fact, doing this check might cause a failure"},{"line_number":21,"context_line":"of the delete operation if an IP allocation is made concurrently."},{"line_number":22,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"1a930d6b_26123a57","line":19,"in_reply_to":"1a930d6b_aea29348","updated":"2015-01-26 17:43:10.000000000","message":"Yes. This is when I realize I have serious brain damage.","commit_id":"e8943816ef13b89010669d277e5e7d95c761adb7"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"fc1950d2957c12586b2fa75d8720189b1045b76e","unresolved":false,"context_lines":[{"line_number":24,"context_line":"IP allocations on the subnet to avoid code duplication. Usage of"},{"line_number":25,"context_line":"SqlAlchemy first() is replaced with one()."},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"Closes Bug: #1414199"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"Change-Id: I1c4ca6f677845f6e2e8d88f3629c0e91ca73b5d0"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"1a930d6b_d996c74b","line":27,"updated":"2015-01-26 12:04:10.000000000","message":"nit: a dash is missing Closes-Bug ...I was not able to open the bug link directly","commit_id":"e8943816ef13b89010669d277e5e7d95c761adb7"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"67dbfbc1558a31aeb0e41b6aef4ecff6adc27bd1","unresolved":false,"context_lines":[{"line_number":24,"context_line":"IP allocations on the subnet to avoid code duplication. Usage of"},{"line_number":25,"context_line":"SqlAlchemy first() is replaced with one()."},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"Closes Bug: #1414199"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"Change-Id: I1c4ca6f677845f6e2e8d88f3629c0e91ca73b5d0"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"1a930d6b_a62d4a97","line":27,"in_reply_to":"1a930d6b_d996c74b","updated":"2015-01-26 17:43:10.000000000","message":"right. I noticed that too.","commit_id":"e8943816ef13b89010669d277e5e7d95c761adb7"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"43b1a1689a8c80db95ab3785f95d7fc8424a5cbd","unresolved":false,"context_lines":[{"line_number":22,"context_line":""},{"line_number":23,"context_line":"This patch also factors out the logic for checking whether there are"},{"line_number":24,"context_line":"IP allocations on the subnet to avoid code duplication. Usage of"},{"line_number":25,"context_line":"SqlAlchemy first() is replaced with one()."},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"Closes-Bug: #1414199"},{"line_number":28,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"fa81d914_28de1540","line":25,"updated":"2015-01-28 17:28:37.000000000","message":"last sentence is obsolete","commit_id":"ebcf686d3c9cd812bc5794e9e56078dc20617bd7"}],"neutron/db/db_base_plugin_v2.py":[{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"b224befb3ef97ce69a1f47a5b806f8db6605b748","unresolved":false,"context_lines":[{"line_number":1221,"context_line":"        try:"},{"line_number":1222,"context_line":"            context.session.query("},{"line_number":1223,"context_line":"                models_v2.IPAllocation).filter_by("},{"line_number":1224,"context_line":"                    subnet_id\u003dsubnet_id).join(models_v2.Port).one()"},{"line_number":1225,"context_line":"        except exc.NoResultFound:"},{"line_number":1226,"context_line":"            return False"},{"line_number":1227,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a930d6b_496f802b","line":1224,"updated":"2015-01-24 13:26:47.000000000","message":"iirc, a subnet can have multiple ipallocations ... so one() can also raise a MultipleResultsFound error, i would prefer first(). Using .first() would also simplify the code (try except no more needed)","commit_id":"e8943816ef13b89010669d277e5e7d95c761adb7"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"11bd1314584960df2ea184fec712db504a5542a5","unresolved":false,"context_lines":[{"line_number":1221,"context_line":"        try:"},{"line_number":1222,"context_line":"            context.session.query("},{"line_number":1223,"context_line":"                models_v2.IPAllocation).filter_by("},{"line_number":1224,"context_line":"                    subnet_id\u003dsubnet_id).join(models_v2.Port).one()"},{"line_number":1225,"context_line":"        except exc.NoResultFound:"},{"line_number":1226,"context_line":"            return False"},{"line_number":1227,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a930d6b_9d8098c1","line":1224,"in_reply_to":"1a930d6b_26407a33","updated":"2015-01-26 18:49:41.000000000","message":"According to doc[1], first performs one queries with a LIMIT 1 where one queries without LIMIT to check result \"uniqueness\"\n\n\n\n[1] http://docs.sqlalchemy.org/en/rel_0_9/orm/query.html?highlight\u003dfirst#sqlalchemy.orm.query.Query.first","commit_id":"e8943816ef13b89010669d277e5e7d95c761adb7"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"fc1950d2957c12586b2fa75d8720189b1045b76e","unresolved":false,"context_lines":[{"line_number":1221,"context_line":"        try:"},{"line_number":1222,"context_line":"            context.session.query("},{"line_number":1223,"context_line":"                models_v2.IPAllocation).filter_by("},{"line_number":1224,"context_line":"                    subnet_id\u003dsubnet_id).join(models_v2.Port).one()"},{"line_number":1225,"context_line":"        except exc.NoResultFound:"},{"line_number":1226,"context_line":"            return False"},{"line_number":1227,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a930d6b_f96623ec","line":1224,"in_reply_to":"1a930d6b_496f802b","updated":"2015-01-26 12:04:10.000000000","message":"I agree with Cedric here, what\u0027s the reason that made you go for one() instead of first() ?","commit_id":"e8943816ef13b89010669d277e5e7d95c761adb7"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"67dbfbc1558a31aeb0e41b6aef4ecff6adc27bd1","unresolved":false,"context_lines":[{"line_number":1221,"context_line":"        try:"},{"line_number":1222,"context_line":"            context.session.query("},{"line_number":1223,"context_line":"                models_v2.IPAllocation).filter_by("},{"line_number":1224,"context_line":"                    subnet_id\u003dsubnet_id).join(models_v2.Port).one()"},{"line_number":1225,"context_line":"        except exc.NoResultFound:"},{"line_number":1226,"context_line":"            return False"},{"line_number":1227,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a930d6b_26407a33","line":1224,"in_reply_to":"1a930d6b_f96623ec","updated":"2015-01-26 17:43:10.000000000","message":"The reason that one() does a limit 1 query in the sqlalchemy backend which is more efficient. But we\u0027re splitting hairs here, I can revert to first!","commit_id":"e8943816ef13b89010669d277e5e7d95c761adb7"}]}
